-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Add from_ref
and from_mut
constructors to core::ptr::NonNull
.
#130822
Conversation
043987d
to
2a97fdd
Compare
This comment has been minimized.
This comment has been minimized.
2a97fdd
to
1e39e34
Compare
This comment has been minimized.
This comment has been minimized.
This will need an ACP, or at least libs-api signoff. An ACP is just an issue template at https://github.com/rust-lang/libs-team/.
Should probably be moved to its own commit to keep updates from that and updates from the new API separate (e.g. the MIR test needs to be blessed) |
1e39e34
to
1bcb831
Compare
I've removed the |
This comment has been minimized.
This comment has been minimized.
1bcb831
to
94ab726
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@bors r+ |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#130822 (Add `from_ref` and `from_mut` constructors to `core::ptr::NonNull`.) - rust-lang#131381 (Implement edition 2024 match ergonomics restrictions) - rust-lang#131594 (rustdoc: Rename "object safe" to "dyn compatible") - rust-lang#131686 (Add fast-path when computing the default visibility) - rust-lang#131699 (Try to improve error messages involving aliases in the solver) - rust-lang#131757 (Ignore lint-non-snake-case-crate#proc_macro_ on targets without unwind) - rust-lang#131783 (Fix explicit_iter_loop in rustc_serialize) - rust-lang#131788 (Fix mismatched quotation mark) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130822 - bjoernager:non-null-from-ref, r=dtolnay Add `from_ref` and `from_mut` constructors to `core::ptr::NonNull`. Relevant tracking issue: rust-lang#130823 The `core::ptr::NonNull` type should have the convenience constructors `from_ref` and `from_mut` for parity with `core::ptr::from_ref` and `core::ptr::from_mut`. Although the type in question already implements `From<&T>` and `From<&mut T>`, these new functions also carry the ability to be used in constant expressions (due to not being behind a trait).
Relevant tracking issue: #130823
The
core::ptr::NonNull
type should have the convenience constructorsfrom_ref
andfrom_mut
for parity withcore::ptr::from_ref
andcore::ptr::from_mut
.Although the type in question already implements
From<&T>
andFrom<&mut T>
, these new functions also carry the ability to be used in constant expressions (due to not being behind a trait).