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/libarena | |
| 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/libarena')
| -rw-r--r-- | src/libarena/lib.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index a3cfc15895e..321fa2edd56 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -31,7 +31,6 @@ #![feature(alloc)] #![feature(core_intrinsics)] #![feature(dropck_eyepatch)] -#![feature(heap_api)] #![feature(generic_param_attrs)] #![feature(staged_api)] #![cfg_attr(test, feature(test))] @@ -48,7 +47,6 @@ use std::mem; use std::ptr; use std::slice; -use alloc::heap; use alloc::raw_vec::RawVec; /// An arena that can hold objects of only one type. @@ -140,7 +138,7 @@ impl<T> TypedArena<T> { unsafe { if mem::size_of::<T>() == 0 { self.ptr.set(intrinsics::arith_offset(self.ptr.get() as *mut u8, 1) as *mut T); - let ptr = heap::EMPTY as *mut T; + let ptr = mem::align_of::<T>() as *mut T; // Don't drop the object. This `write` is equivalent to `forget`. ptr::write(ptr, object); &mut *ptr |
