From 999690ce5d43721d1b1c7fdeb9b58748976b10b5 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 31 May 2018 19:33:13 +0200 Subject: [PATCH] Stabilize the #[global_allocator] attribute Fixes https://github.com/rust-lang/rust/issues/27389 --- src/libsyntax/feature_gate.rs | 10 +++------- src/test/ui/feature-gate-global_allocator.rs | 14 -------------- src/test/ui/feature-gate-global_allocator.stderr | 11 ----------- 3 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 src/test/ui/feature-gate-global_allocator.rs delete mode 100644 src/test/ui/feature-gate-global_allocator.stderr diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 5f0cf49cd96cf..1535e6495067b 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -357,8 +357,6 @@ declare_features! ( // Trait aliases (active, trait_alias, "1.24.0", Some(41517), None), - // global allocators and their internals - (active, global_allocator, "1.20.0", Some(27389), None), // rustc internal (active, allocator_internals, "1.20.0", None, None), @@ -615,6 +613,8 @@ declare_features! ( (accepted, macro_lifetime_matcher, "1.27.0", Some(34303), None), // Termination trait in tests (RFC 1937) (accepted, termination_trait_test, "1.27.0", Some(48854), None), + // The #[global_allocator] attribute + (accepted, global_allocator, "1.28.0", Some(27389), None), ); // If you change this, please modify src/doc/unstable-book as well. You must @@ -776,11 +776,7 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG "the `#[rustc_const_unstable]` attribute \ is an internal feature", cfg_fn!(rustc_const_unstable))), - ("global_allocator", Normal, Gated(Stability::Unstable, - "global_allocator", - "the `#[global_allocator]` attribute is \ - an experimental feature", - cfg_fn!(global_allocator))), + ("global_allocator", Normal, Ungated), ("default_lib_allocator", Whitelisted, Gated(Stability::Unstable, "allocator_internals", "the `#[default_lib_allocator]` \ diff --git a/src/test/ui/feature-gate-global_allocator.rs b/src/test/ui/feature-gate-global_allocator.rs deleted file mode 100644 index ff3c342f9e003..0000000000000 --- a/src/test/ui/feature-gate-global_allocator.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[global_allocator] //~ ERROR: attribute is an experimental feature -static A: usize = 0; - -fn main() {} diff --git a/src/test/ui/feature-gate-global_allocator.stderr b/src/test/ui/feature-gate-global_allocator.stderr deleted file mode 100644 index 9f8b98ede09f1..0000000000000 --- a/src/test/ui/feature-gate-global_allocator.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0658]: the `#[global_allocator]` attribute is an experimental feature (see issue #27389) - --> $DIR/feature-gate-global_allocator.rs:11:1 - | -LL | #[global_allocator] //~ ERROR: attribute is an experimental feature - | ^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(global_allocator)] to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`.