Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify some pointer method implementations #103701

Conversation

WaffleLapkin
Copy link
Member

r? @scottmcm


from_raw_parts::<T>(this, metadata(self)) was annoying me for a while and I've finally figured out how it should actually be done.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 28, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 28, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@scottmcm
Copy link
Member

Looks good to me! Thanks.

@bors r+

@bors
Copy link
Contributor

bors commented Nov 14, 2022

📌 Commit d3b5192 has been approved by scottmcm

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 14, 2022
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 18, 2022
…ation__--this-can-be-simplified, r=scottmcm

Simplify some pointer method implementations

- Make `pointer::with_metadata_of` const (+simplify implementation) (cc rust-lang#75091)
- Simplify implementation of various pointer methods

r? `@scottmcm`

----

`from_raw_parts::<T>(this, metadata(self))` was annoying me for a while and I've finally figured out how it should _actually_ be done.
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 18, 2022
…ation__--this-can-be-simplified, r=scottmcm

Simplify some pointer method implementations

- Make `pointer::with_metadata_of` const (+simplify implementation) (cc rust-lang#75091)
- Simplify implementation of various pointer methods

r? ``@scottmcm``

----

`from_raw_parts::<T>(this, metadata(self))` was annoying me for a while and I've finally figured out how it should _actually_ be done.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 18, 2022
…earth

Rollup of 8 pull requests

Successful merges:

 - rust-lang#102977 (remove HRTB from `[T]::is_sorted_by{,_key}`)
 - rust-lang#103378 (Fix mod_inv termination for the last iteration)
 - rust-lang#103456 (`unchecked_{shl|shr}` should use `u32` as the RHS)
 - rust-lang#103701 (Simplify some pointer method implementations)
 - rust-lang#104047 (Diagnostics `icu4x` based list formatting.)
 - rust-lang#104338 (Enforce that `dyn*` coercions are actually pointer-sized)
 - rust-lang#104498 (Edit docs for `rustc_errors::Handler::stash_diagnostic`)
 - rust-lang#104556 (rustdoc: use `code-header` class to format enum variants)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 19efa25 into rust-lang:master Nov 19, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 19, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 10, 2023
…jubilee

Fix the docs for pointer method with_metadata_of

The name of the argument to `{*const T, *mut T}::with_metadata_of` was changed from `val` to `meta` recently, but the docs weren't updated to match.

Relevant pull request: rust-lang#103701
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants