Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/rustc_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
#![allow(internal_features)]
#![allow(rustc::default_hash_types)]
#![allow(rustc::potential_query_instability)]
#![cfg_attr(bootstrap, feature(allocator_api))]
#![cfg_attr(not(bootstrap), feature(allocator_ext))]
#![cfg_attr(test, feature(test))]
#![deny(unsafe_op_in_unsafe_fn)]
#![feature(allocator_api)]
#![feature(ascii_char)]
#![feature(ascii_char_variants)]
#![feature(auto_traits)]
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![cfg_attr(bootstrap, feature(allocator_api))]
#![cfg_attr(doc, feature(intra_doc_pointers))]
#![feature(allocator_api)]
#![cfg_attr(not(bootstrap), feature(allocator_ext))]
#![feature(associated_type_defaults)]
#![feature(closure_track_caller)]
#![feature(const_default)]
Expand Down
8 changes: 4 additions & 4 deletions library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ unsafe extern "Rust" {
///
/// Note: while this type is unstable, the functionality it provides can be
/// accessed through the [free functions in `alloc`](self#functions).
#[unstable(feature = "allocator_api", issue = "32838")]
#[stable(feature = "allocator_api", since = "CURRENT_RUSTC_VERSION")]
#[derive(Copy, Debug)]
#[derive_const(Clone, Default)]
// the compiler needs to know when a Box uses the global allocator vs a custom one
#[lang = "global_alloc_ty"]
pub struct Global;

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

#[unstable(feature = "allocator_api", issue = "32838")]
#[unstable(feature = "allocator_ext", issue = "32838", implied_by = "allocator_api")]
unsafe impl core::alloc::StaticAllocator for Global {}

/// Allocates memory with the global allocator.
Expand Down Expand Up @@ -532,7 +532,7 @@ impl Global {
}
}

#[unstable(feature = "allocator_api", issue = "32838")]
#[stable(feature = "allocator_api", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_unstable(feature = "const_heap", issue = "79597")]
const unsafe impl Allocator for Global {
#[inline]
Expand Down
Loading
Loading