]> git.lizzy.rs Git - rust.git/commitdiff
Rename NonNull::empty to dangling.
authorSimon Sapin <simon.sapin@exyr.org>
Wed, 10 Jan 2018 08:30:04 +0000 (09:30 +0100)
committerSimon Sapin <simon.sapin@exyr.org>
Sat, 20 Jan 2018 10:09:23 +0000 (11:09 +0100)
src/libcore/ptr.rs

index 261291b747f89afdf9fd1e25a5bb12bc6ba37f2e..fab5832d905df8262bfbaa85971ef913e8711844 100644 (file)
@@ -2370,6 +2370,7 @@ impl<T: Sized> Unique<T> {
     ///
     /// 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::<T>() as *mut T;
@@ -2509,7 +2510,7 @@ impl<T: Sized> NonNull<T> {
     /// 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::<T>() as *mut T;
             NonNull::new_unchecked(ptr)