From c7cffc5f4ef1def337ca2a294c3ca855ee703419 Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Thu, 4 May 2017 14:48:58 -0400 Subject: Deprecate heap::EMPTY in favour of Unique::empty or otherwise. --- src/libcollections/vec.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libcollections') 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 Iterator for IntoIter { 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 DoubleEndedIterator for IntoIter { 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); -- cgit 1.4.1-3-g733a5