Skip to content

Commit

Permalink
Auto merge of #117697 - WaffleLapkin:non-null-convenience-ops, r=Amanieu
Browse files Browse the repository at this point in the history
Non null convenience ops

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...

<sub>I'm eepy, so I probably messed up somewhere while copying...</sub>

cc `@scottmcm`
r? libs-api
  • Loading branch information
bors committed Nov 26, 2023
2 parents 3bb0171 + e1b4e8a commit 1bcbb7c
Show file tree
Hide file tree
Showing 2 changed files with 1,029 additions and 19 deletions.
1 change: 1 addition & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
#![feature(is_ascii_octdigit)]
#![feature(isqrt)]
#![feature(maybe_uninit_uninit_array)]
#![feature(non_null_convenience)]
#![feature(offset_of)]
#![feature(offset_of_enum)]
#![feature(ptr_alignment_type)]
Expand Down
Loading

0 comments on commit 1bcbb7c

Please sign in to comment.