about summary refs log tree commit diff
path: root/src/liballoc/heap.rs
diff options
context:
space:
mode:
authorAlexis Beingessner <a.beingessner@gmail.com>2017-05-04 14:48:58 -0400
committerAlexis Beingessner <a.beingessner@gmail.com>2017-05-04 23:54:54 -0400
commitc7cffc5f4ef1def337ca2a294c3ca855ee703419 (patch)
tree6d112c6462a626413c82467cd5de05af3ae41d05 /src/liballoc/heap.rs
parent4ff583b1161c5c2e08c28a0740f34a526b39a8bc (diff)
downloadrust-c7cffc5f4ef1def337ca2a294c3ca855ee703419.tar.gz
rust-c7cffc5f4ef1def337ca2a294c3ca855ee703419.zip
Deprecate heap::EMPTY in favour of Unique::empty or otherwise.
Diffstat (limited to 'src/liballoc/heap.rs')
-rw-r--r--src/liballoc/heap.rs6
1 files changed, 4 insertions, 2 deletions
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<T>`. 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() {