From 76b686f78d97a90d9a563a0446de2d86b437e78e Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 10 Jan 2018 09:30:04 +0100 Subject: [PATCH] Rename NonNull::empty to dangling. --- src/libcore/ptr.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 261291b747f..fab5832d905 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -2370,6 +2370,7 @@ impl Unique { /// /// This is useful for initializing types which lazily allocate, like /// `Vec::new` does. + // FIXME: rename to dangling() to match NonNull? pub fn empty() -> Self { unsafe { let ptr = mem::align_of::() as *mut T; @@ -2509,7 +2510,7 @@ impl NonNull { /// This is useful for initializing types which lazily allocate, like /// `Vec::new` does. #[stable(feature = "nonnull", since = "1.24.0")] - pub fn empty() -> Self { + pub fn dangling() -> Self { unsafe { let ptr = mem::align_of::() as *mut T; NonNull::new_unchecked(ptr)