about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorcohenarthur <arthur.cohen@epita.fr>2020-04-30 11:00:45 +0200
committercohenarthur <arthur.cohen@epita.fr>2020-04-30 11:00:45 +0200
commiteda7f8fdff16aee5ff30b150555c479f885ba993 (patch)
tree3ad0d0b09e0aba9b143492dbf327cb77c1da11dd /src/liballoc
parent7c8dbd969dd0ef2af6d8bab9e03ba7ce6cac41a2 (diff)
downloadrust-eda7f8fdff16aee5ff30b150555c479f885ba993.tar.gz
rust-eda7f8fdff16aee5ff30b150555c479f885ba993.zip
rename-unique: Rename Unique::empty() to Unique::dangling()
rename-unique: Change calls and doc in raw_vec.rs

rename-unique: Change empty() -> dangling() in const-ptr-unique-rpass.rs
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/raw_vec.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs
index ca165b61e26..a8e19c9cbaa 100644
--- a/src/liballoc/raw_vec.rs
+++ b/src/liballoc/raw_vec.rs
@@ -25,9 +25,9 @@ mod tests;
 /// involved. This type is excellent for building your own data structures like Vec and VecDeque.
 /// In particular:
 ///
-/// * Produces `Unique::empty()` on zero-sized types.
-/// * Produces `Unique::empty()` on zero-length allocations.
-/// * Avoids freeing `Unique::empty()`.
+/// * Produces `Unique::dangling()` on zero-sized types.
+/// * Produces `Unique::dangling()` on zero-length allocations.
+/// * Avoids freeing `Unique::dangling()`.
 /// * Catches all overflows in capacity computations (promotes them to "capacity overflow" panics).
 /// * Guards against 32-bit systems allocating more than isize::MAX bytes.
 /// * Guards against overflowing your length.
@@ -125,7 +125,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
     /// the returned `RawVec`.
     pub const fn new_in(alloc: A) -> Self {
         // `cap: 0` means "unallocated". zero-sized types are ignored.
-        Self { ptr: Unique::empty(), cap: 0, alloc }
+        Self { ptr: Unique::dangling(), cap: 0, alloc }
     }
 
     /// Like `with_capacity`, but parameterized over the choice of
@@ -172,7 +172,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
     }
 
     /// Gets a raw pointer to the start of the allocation. Note that this is
-    /// `Unique::empty()` if `capacity == 0` or `T` is zero-sized. In the former case, you must
+    /// `Unique::dangling()` if `capacity == 0` or `T` is zero-sized. In the former case, you must
     /// be careful.
     pub fn ptr(&self) -> *mut T {
         self.ptr.as_ptr()