-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stabilize #[used] #51363
stabilize #[used] #51363
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,9 +349,6 @@ declare_features! ( | |
// Allows the `try {...}` expression | ||
(active, try_blocks, "1.29.0", Some(31436), None), | ||
|
||
// Used to preserve symbols (see llvm.used) | ||
(active, used, "1.18.0", Some(40289), None), | ||
|
||
// Allows module-level inline assembly by way of global_asm!() | ||
(active, global_asm, "1.18.0", Some(35119), None), | ||
|
||
|
@@ -674,6 +671,9 @@ declare_features! ( | |
// Allows all literals in attribute lists and values of key-value pairs. | ||
(accepted, attr_literals, "1.30.0", Some(34981), None), | ||
(accepted, panic_handler, "1.30.0", Some(44489), None), | ||
// Used to preserve symbols (see llvm.used) | ||
(accepted, used, "1.29.0", Some(40289), None), | ||
|
||
); | ||
|
||
// If you change this, please modify src/doc/unstable-book as well. You must | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we even have an entry in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes.
I asked in the PR description where the documentation should be moved to as there are a few options (reference, book, RBE, etc.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have assumed to add it to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @steveklabnik thinks otherwise (cf. #51366 (comment) and #51366 (comment)). I'll prep a PR to add documentation to the reference and the nomicon. |
||
|
@@ -1064,10 +1064,7 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG | |
"unwind_attributes", | ||
"#[unwind] is experimental", | ||
cfg_fn!(unwind_attributes))), | ||
("used", Whitelisted, Gated( | ||
Stability::Unstable, "used", | ||
"the `#[used]` attribute is an experimental feature", | ||
cfg_fn!(used))), | ||
("used", Whitelisted, Ungated), | ||
|
||
// used in resolve | ||
("prelude_import", Whitelisted, Gated(Stability::Unstable, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
error[E0658]: the `#[used]` attribute is an experimental feature (see issue #40289) | ||
error: attribute must be applied to a `static` variable | ||
--> $DIR/feature-gate-linker-flavor.rs:16:1 | ||
| | ||
LL | #[used] | ||
| ^^^^^^^ | ||
| | ||
= help: add #![feature(used)] to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
// run-pass | ||
#![deny(dead_code)] | ||
#![feature(used)] | ||
|
||
#[used] | ||
static FOO: u32 = 0; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time flies, this should be 1.30.0 now (or 1.31.0 if it can't be merged this week).