-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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+ |
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).