Skip to content
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

Merged
merged 4 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from 3 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
157 changes: 0 additions & 157 deletions src/doc/unstable-book/src/language-features/used.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
#![feature(doc_cfg)]
#![feature(doc_masked)]
#![feature(doc_spotlight)]
#![cfg_attr(windows, feature(used))]
#![cfg_attr(all(windows, stage0), feature(used))]
#![feature(doc_alias)]
#![feature(doc_keyword)]
#![feature(panic_info_message)]
Expand Down
11 changes: 4 additions & 7 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),

Expand Down Expand Up @@ -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),
Copy link
Member

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).


);

// If you change this, please modify src/doc/unstable-book as well. You must
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even have an entry in the unstable-book? If yes, apply this comment, if no, we should probably document it together with stabilization.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even have an entry in the unstable-book?

Yes.

If yes, apply this comment

I asked in the PR description where the documentation should be moved to as there are a few options (reference, book, RBE, etc.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have assumed to add it to the book, because that would have been where I'd have searched for it.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/test/run-make-fulldeps/used/used.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// except according to those terms.

#![crate_type = "lib"]
#![feature(used)]

#[used]
static FOO: u32 = 0;
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/feature-gates/feature-gate-linker-flavor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -15,6 +15,5 @@

#[used]
fn foo() {}
//~^^ ERROR the `#[used]` attribute is an experimental feature

fn main() {}
5 changes: 1 addition & 4 deletions src/test/ui/feature-gates/feature-gate-linker-flavor.stderr
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`.
15 changes: 0 additions & 15 deletions src/test/ui/feature-gates/feature-gate-used.rs

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/ui/feature-gates/feature-gate-used.stderr

This file was deleted.

1 change: 0 additions & 1 deletion src/test/ui/run-pass/issues/issue-41628.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

// run-pass
#![deny(dead_code)]
#![feature(used)]

#[used]
static FOO: u32 = 0;
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/used.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(used)]

#[used]
static FOO: u32 = 0; // OK

Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/used.stderr
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error: attribute must be applied to a `static` variable
--> $DIR/used.rs:16:1
--> $DIR/used.rs:14:1
|
LL | #[used] //~ ERROR attribute must be applied to a `static` variable
| ^^^^^^^

error: attribute must be applied to a `static` variable
--> $DIR/used.rs:19:1
--> $DIR/used.rs:17:1
|
LL | #[used] //~ ERROR attribute must be applied to a `static` variable
| ^^^^^^^

error: attribute must be applied to a `static` variable
--> $DIR/used.rs:22:1
--> $DIR/used.rs:20:1
|
LL | #[used] //~ ERROR attribute must be applied to a `static` variable
| ^^^^^^^

error: attribute must be applied to a `static` variable
--> $DIR/used.rs:25:1
--> $DIR/used.rs:23:1
|
LL | #[used] //~ ERROR attribute must be applied to a `static` variable
| ^^^^^^^
Expand Down