-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Non null convenience ops #117697
Non null convenience ops #117697
Conversation
☔ The latest upstream changes (presumably #117525) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry this somehow fell off my queue. r=me once conflicts are resolved. |
8ca7c33
to
1dbc7c2
Compare
1dbc7c2
to
e1b4e8a
Compare
@bors r=Amanieu |
// #[unstable(feature = "ptr_sub_ptr", issue = "95892")] | ||
// #[rustc_const_unstable(feature = "const_ptr_sub_ptr", issue = "95892")] |
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.
commented out code
/// [`ptr::write`]: crate::ptr::write() | ||
#[unstable(feature = "non_null_convenience", issue = "117691")] | ||
#[rustc_const_unstable(feature = "non_null_convenience", issue = "117691")] | ||
//#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")] |
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.
here too
#[doc(alias = "memset")] | ||
#[unstable(feature = "non_null_convenience", issue = "117691")] | ||
#[rustc_const_unstable(feature = "non_null_convenience", issue = "117691")] | ||
//#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")] |
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.
here
/// [`ptr::write_unaligned`]: crate::ptr::write_unaligned() | ||
#[unstable(feature = "non_null_convenience", issue = "117691")] | ||
#[rustc_const_unstable(feature = "non_null_convenience", issue = "117691")] | ||
//#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")] |
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.
here
/// [`ptr::swap`]: crate::ptr::swap() | ||
#[unstable(feature = "non_null_convenience", issue = "117691")] | ||
#[rustc_const_unstable(feature = "non_null_convenience", issue = "117691")] | ||
//#[rustc_const_unstable(feature = "const_swap", issue = "83163")] |
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.
too
/// ``` | ||
#[unstable(feature = "non_null_convenience", issue = "117691")] | ||
#[rustc_const_unstable(feature = "non_null_convenience", issue = "117691")] | ||
//#[rustc_const_unstable(feature = "const_align_offset", issue = "90962")] |
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.
...
@bors r- |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1bcbb7c): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 676.117s -> 676.261s (0.02%) |
Based on rust-lang/libs-team#251.
I went through all of the methods on
*mut
and added every method, which does not require additional safety conditions, toNonNull
. (exceptions:guaranteed_eq
,guaranteed_ne
,with_metadata_of
, it's unclear if they are useful here...)I'm also not sure what types should the "second pointer parameter" be.
*mut
/*const
might be more permissible, but given thatNonNull
doesn't coerce to them, it might also be annoying. For now I chose the "useNonNull
everywhere" path, but I'm not sure it's the correct one...I'm eepy, so I probably messed up somewhere while copying...
cc @scottmcm
r? libs-api