Skip to content

Commit 743c29b

Browse files
committed
Actually deprecate heap modules.
1 parent 09e8db1 commit 743c29b

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

src/liballoc/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use core::mem::{self, ManuallyDrop};
2020
use core::usize;
2121

2222
#[doc(inline)]
23-
pub use core::heap::*;
23+
pub use core::alloc::*;
2424

2525
#[doc(hidden)]
2626
pub mod __core {

src/liballoc/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,21 @@ mod macros;
141141

142142
#[rustc_deprecated(since = "1.27.0", reason = "use the heap module in core, alloc, or std instead")]
143143
#[unstable(feature = "allocator_api", issue = "32838")]
144-
pub use core::heap as allocator;
144+
/// Use the `alloc` module instead.
145+
pub mod allocator {
146+
pub use alloc::*;
147+
}
145148

146149
// Heaps provided for low-level allocation strategies
147150

148151
pub mod alloc;
149152

150153
#[unstable(feature = "allocator_api", issue = "32838")]
151154
#[rustc_deprecated(since = "1.27.0", reason = "module renamed to `alloc`")]
152-
pub use alloc as heap;
155+
/// Use the `alloc` module instead.
156+
pub mod heap {
157+
pub use alloc::*;
158+
}
153159

154160
// Primitive types using the heaps above
155161

src/libcore/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ pub mod alloc;
189189

190190
#[unstable(feature = "allocator_api", issue = "32838")]
191191
#[rustc_deprecated(since = "1.27.0", reason = "module renamed to `alloc`")]
192-
pub use alloc as heap;
192+
/// Use the `alloc` module instead.
193+
pub mod heap {
194+
pub use alloc::*;
195+
}
193196

194197
// note: does not need to be public
195198
mod iter_private;

src/libstd/alloc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
1313
#![unstable(issue = "32838", feature = "allocator_api")]
1414

15-
pub use alloc_crate::heap::Heap;
16-
pub use alloc_system::System;
17-
#[doc(inline)] pub use core::heap::*;
15+
#[doc(inline)] pub use alloc_crate::alloc::Heap;
16+
#[doc(inline)] pub use alloc_system::System;
17+
#[doc(inline)] pub use core::alloc::*;
1818

1919
#[cfg(not(test))]
2020
#[doc(hidden)]

src/libstd/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,10 @@ pub mod alloc;
481481

482482
#[unstable(feature = "allocator_api", issue = "32838")]
483483
#[rustc_deprecated(since = "1.27.0", reason = "module renamed to `alloc`")]
484-
pub use alloc as heap;
484+
/// Use the `alloc` module instead.
485+
pub mod heap {
486+
pub use alloc::*;
487+
}
485488

486489
// Platform-abstraction modules
487490
#[macro_use]

0 commit comments

Comments
 (0)