We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5aeeaff commit 76b686fCopy full SHA for 76b686f
src/libcore/ptr.rs
@@ -2370,6 +2370,7 @@ impl<T: Sized> Unique<T> {
2370
///
2371
/// This is useful for initializing types which lazily allocate, like
2372
/// `Vec::new` does.
2373
+ // FIXME: rename to dangling() to match NonNull?
2374
pub fn empty() -> Self {
2375
unsafe {
2376
let ptr = mem::align_of::<T>() as *mut T;
@@ -2509,7 +2510,7 @@ impl<T: Sized> NonNull<T> {
2509
2510
2511
2512
#[stable(feature = "nonnull", since = "1.24.0")]
- pub fn empty() -> Self {
2513
+ pub fn dangling() -> Self {
2514
2515
2516
NonNull::new_unchecked(ptr)
0 commit comments