Skip to content

Commit 1bcbb7c

Browse files
committed
Auto merge of rust-lang#117697 - WaffleLapkin:non-null-convenience-ops, r=Amanieu
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
2 parents 3bb0171 + e1b4e8a commit 1bcbb7c

File tree

2 files changed

+1029
-19
lines changed

2 files changed

+1029
-19
lines changed

library/core/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
#![feature(is_ascii_octdigit)]
179179
#![feature(isqrt)]
180180
#![feature(maybe_uninit_uninit_array)]
181+
#![feature(non_null_convenience)]
181182
#![feature(offset_of)]
182183
#![feature(offset_of_enum)]
183184
#![feature(ptr_alignment_type)]

0 commit comments

Comments
 (0)