

Non null convenience ops by WaffleLapkin · Pull Request #117697 · rust-lang/rust...
source link: https://github.com/rust-lang/rust/pull/117697
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation
Member
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, to NonNull
. (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 that NonNull
doesn't coerce to them, it might also be annoying. For now I chose the "use NonNull
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
Recommend
-
13
New issue Fix leak in Vec::extend_from_within #82760
-
11
Copy link Contributor WaffleLapkin ...
-
5
Copy link Contributor WaffleLapkin commented
-
8
New issue Make UnsafeCell::get_mut const #88722
-
6
New issue Stabilize Iterator::map_while #89086
-
9
Copy link Contributor
-
5
Copy link Contributor WaffleLapkin ...
-
9
// char), or entirely non-surrogates (1 element per char) (low / 2, high) ...
-
7
Copy link Contributor
-
10
This comment has been minimized.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK