Skip to content

Commit 2fb5d5d

Browse files
committed
stabilize #[used]
closes rust-lang#40289
1 parent df6ba0c commit 2fb5d5d

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

src/libstd/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
#![feature(doc_cfg)]
308308
#![feature(doc_masked)]
309309
#![feature(doc_spotlight)]
310-
#![cfg_attr(windows, feature(used))]
310+
#![cfg_attr(all(windows, stage0), feature(used))]
311311
#![feature(doc_alias)]
312312
#![feature(doc_keyword)]
313313
#![feature(panic_info_message)]

src/libsyntax/feature_gate.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,6 @@ declare_features! (
349349
// Allows the `try {...}` expression
350350
(active, try_blocks, "1.29.0", Some(31436), None),
351351

352-
// Used to preserve symbols (see llvm.used)
353-
(active, used, "1.18.0", Some(40289), None),
354-
355352
// Allows module-level inline assembly by way of global_asm!()
356353
(active, global_asm, "1.18.0", Some(35119), None),
357354

@@ -674,6 +671,9 @@ declare_features! (
674671
// Allows all literals in attribute lists and values of key-value pairs.
675672
(accepted, attr_literals, "1.30.0", Some(34981), None),
676673
(accepted, panic_handler, "1.30.0", Some(44489), None),
674+
// Used to preserve symbols (see llvm.used)
675+
(accepted, used, "1.29.0", Some(40289), None),
676+
677677
);
678678

679679
// If you change this, please modify src/doc/unstable-book as well. You must
@@ -1064,10 +1064,7 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
10641064
"unwind_attributes",
10651065
"#[unwind] is experimental",
10661066
cfg_fn!(unwind_attributes))),
1067-
("used", Whitelisted, Gated(
1068-
Stability::Unstable, "used",
1069-
"the `#[used]` attribute is an experimental feature",
1070-
cfg_fn!(used))),
1067+
("used", Whitelisted, Ungated),
10711068

10721069
// used in resolve
10731070
("prelude_import", Whitelisted, Gated(Stability::Unstable,

src/test/run-make-fulldeps/used/used.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
#![crate_type = "lib"]
12-
#![feature(used)]
1312

1413
#[used]
1514
static FOO: u32 = 0;

src/test/ui/run-pass/issues/issue-41628.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// run-pass
1212
#![deny(dead_code)]
13-
#![feature(used)]
1413

1514
#[used]
1615
static FOO: u32 = 0;

src/test/ui/used.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(used)]
12-
1311
#[used]
1412
static FOO: u32 = 0; // OK
1513

0 commit comments

Comments
 (0)