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/liballoc/heap.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/liballoc/heap.rs') diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index 056af13016c..5ff21c86483 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -138,7 +138,9 @@ pub fn usable_size(size: usize, align: usize) -> usize { /// /// This preserves the non-null invariant for types like `Box`. The address /// may overlap with non-zero-size memory allocations. -pub const EMPTY: *mut () = 0x1 as *mut (); +#[rustc_deprecated(since = "1.19", reason = "Use Unique/Shared::empty() instead")] +#[unstable(feature = "heap_api", issue = "27700")] +pub const EMPTY: *mut () = 1 as *mut (); /// The allocator for unique pointers. // This function must not unwind. If it does, MIR trans will fail. @@ -147,7 +149,7 @@ pub const EMPTY: *mut () = 0x1 as *mut (); #[inline] unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 { if size == 0 { - EMPTY as *mut u8 + align as *mut u8 } else { let ptr = allocate(size, align); if ptr.is_null() { -- cgit 1.4.1-3-g733a5