@@ -25,9 +25,9 @@ mod tests;
25
25
/// involved. This type is excellent for building your own data structures like Vec and VecDeque.
26
26
/// In particular:
27
27
///
28
- /// * Produces `Unique::empty ()` on zero-sized types.
29
- /// * Produces `Unique::empty ()` on zero-length allocations.
30
- /// * Avoids freeing `Unique::empty ()`.
28
+ /// * Produces `Unique::dangling ()` on zero-sized types.
29
+ /// * Produces `Unique::dangling ()` on zero-length allocations.
30
+ /// * Avoids freeing `Unique::dangling ()`.
31
31
/// * Catches all overflows in capacity computations (promotes them to "capacity overflow" panics).
32
32
/// * Guards against 32-bit systems allocating more than isize::MAX bytes.
33
33
/// * Guards against overflowing your length.
@@ -125,7 +125,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
125
125
/// the returned `RawVec`.
126
126
pub const fn new_in ( alloc : A ) -> Self {
127
127
// `cap: 0` means "unallocated". zero-sized types are ignored.
128
- Self { ptr : Unique :: empty ( ) , cap : 0 , alloc }
128
+ Self { ptr : Unique :: dangling ( ) , cap : 0 , alloc }
129
129
}
130
130
131
131
/// Like `with_capacity`, but parameterized over the choice of
@@ -172,7 +172,7 @@ impl<T, A: AllocRef> RawVec<T, A> {
172
172
}
173
173
174
174
/// Gets a raw pointer to the start of the allocation. Note that this is
175
- /// `Unique::empty ()` if `capacity == 0` or `T` is zero-sized. In the former case, you must
175
+ /// `Unique::dangling ()` if `capacity == 0` or `T` is zero-sized. In the former case, you must
176
176
/// be careful.
177
177
pub fn ptr ( & self ) -> * mut T {
178
178
self . ptr . as_ptr ( )
0 commit comments