Skip to content

Commit f038322

Browse files
committed
alloc: stabilise Allocator
1 parent 3583cf0 commit f038322

87 files changed

Lines changed: 410 additions & 460 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/rustc_data_structures/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
#![allow(internal_features)]
1111
#![allow(rustc::default_hash_types)]
1212
#![allow(rustc::potential_query_instability)]
13+
#![cfg_attr(bootstrap, feature(allocator_api))]
14+
#![cfg_attr(not(bootstrap), feature(allocator_ext))]
1315
#![cfg_attr(test, feature(test))]
1416
#![deny(unsafe_op_in_unsafe_fn)]
15-
#![feature(allocator_api)]
1617
#![feature(ascii_char)]
1718
#![feature(ascii_char_variants)]
1819
#![feature(auto_traits)]

compiler/rustc_middle/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
// tidy-alphabetical-start
2828
#![allow(internal_features)]
2929
#![allow(rustc::direct_use_of_rustc_type_ir)]
30+
#![cfg_attr(bootstrap, feature(allocator_api))]
3031
#![cfg_attr(doc, feature(intra_doc_pointers))]
31-
#![feature(allocator_api)]
32+
#![cfg_attr(not(bootstrap), feature(allocator_ext))]
3233
#![feature(associated_type_defaults)]
3334
#![feature(box_as_ptr)]
3435
#![feature(closure_track_caller)]

library/alloc/src/alloc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ unsafe extern "Rust" {
5151
///
5252
/// Note: while this type is unstable, the functionality it provides can be
5353
/// accessed through the [free functions in `alloc`](self#functions).
54-
#[unstable(feature = "allocator_api", issue = "32838")]
54+
#[stable(feature = "allocator_api", since = "CURRENT_RUSTC_VERSION")]
5555
#[derive(Copy, Clone, Default, Debug)]
5656
// the compiler needs to know when a Box uses the global allocator vs a custom one
5757
#[lang = "global_alloc_ty"]
5858
pub struct Global;
5959

60-
#[unstable(feature = "allocator_api", issue = "32838")]
60+
#[unstable(feature = "allocator_ext", issue = "32838", implied_by = "allocator_api")]
6161
unsafe impl core::alloc::AllocatorClone for Global {}
6262

63-
#[unstable(feature = "allocator_api", issue = "32838")]
63+
#[unstable(feature = "allocator_ext", issue = "32838", implied_by = "allocator_api")]
6464
unsafe impl core::alloc::PinSafeAllocator for Global {}
6565

6666
/// Allocates memory with the global allocator.
@@ -446,7 +446,7 @@ impl Global {
446446
}
447447
}
448448

449-
#[unstable(feature = "allocator_api", issue = "32838")]
449+
#[stable(feature = "allocator_api", since = "CURRENT_RUSTC_VERSION")]
450450
#[rustc_const_unstable(feature = "const_heap", issue = "79597")]
451451
unsafe impl const Allocator for Global {
452452
#[inline]

0 commit comments

Comments
 (0)