diff options
| author | Alexis Beingessner <a.beingessner@gmail.com> | 2017-05-04 14:48:58 -0400 |
|---|---|---|
| committer | Alexis Beingessner <a.beingessner@gmail.com> | 2017-05-04 23:54:54 -0400 |
| commit | c7cffc5f4ef1def337ca2a294c3ca855ee703419 (patch) | |
| tree | 6d112c6462a626413c82467cd5de05af3ae41d05 /src/libcollections | |
| parent | 4ff583b1161c5c2e08c28a0740f34a526b39a8bc (diff) | |
| download | rust-c7cffc5f4ef1def337ca2a294c3ca855ee703419.tar.gz rust-c7cffc5f4ef1def337ca2a294c3ca855ee703419.zip | |
Deprecate heap::EMPTY in favour of Unique::empty or otherwise.
Diffstat (limited to 'src/libcollections')
| -rw-r--r-- | src/libcollections/vec.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 02ad0a67bda..7ec5c29de6b 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -67,7 +67,6 @@ #![stable(feature = "rust1", since = "1.0.0")] use alloc::boxed::Box; -use alloc::heap::EMPTY; use alloc::raw_vec::RawVec; use borrow::ToOwned; use borrow::Cow; @@ -2192,7 +2191,8 @@ impl<T> Iterator for IntoIter<T> { self.ptr = arith_offset(self.ptr as *const i8, 1) as *mut T; // Use a non-null pointer value - Some(ptr::read(EMPTY as *mut T)) + // (self.ptr might be null because of wrapping) + Some(ptr::read(1 as *mut T)) } else { let old = self.ptr; self.ptr = self.ptr.offset(1); @@ -2231,7 +2231,8 @@ impl<T> DoubleEndedIterator for IntoIter<T> { self.end = arith_offset(self.end as *const i8, -1) as *mut T; // Use a non-null pointer value - Some(ptr::read(EMPTY as *mut T)) + // (self.end might be null because of wrapping) + Some(ptr::read(1 as *mut T)) } else { self.end = self.end.offset(-1); |
