about summary refs log tree commit diff
path: root/src/libcore/ptr.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-01-10 09:30:04 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-01-20 11:09:23 +0100
commit76b686f78d97a90d9a563a0446de2d86b437e78e (patch)
tree0b704bd9205327eaa832476dbc000598ac880e16 /src/libcore/ptr.rs
parent5aeeafff49bf099e95caf94719fabcc5008ab95a (diff)
downloadrust-76b686f78d97a90d9a563a0446de2d86b437e78e.tar.gz
rust-76b686f78d97a90d9a563a0446de2d86b437e78e.zip
Rename NonNull::empty to dangling.
Diffstat (limited to 'src/libcore/ptr.rs')
-rw-r--r--src/libcore/ptr.rs3
1 files changed, 2 insertions, 1 deletions
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<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)