Skip to content

Commit 47acd7a

Browse files
Remove help message for stability attributes
1 parent d79693e commit 47acd7a

10 files changed

Lines changed: 7 additions & 75 deletions

compiler/rustc_attr_parsing/src/stability.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ impl<'sess> AttributeParser<'sess> {
5858

5959
let mut diag = feature_err(self.sess, gate_name, attr_span, explain);
6060

61+
// Remove the suggestion for `#![feature(staged_api)]` as these attributes are currently
62+
// not usable outside std. If we do ever expose `#[stable]` etc under a different feature
63+
// name then it would be unfortunate to have nightlies out there suggesting `staged_api`.
64+
if gate_name == sym::staged_api {
65+
diag.children.clear();
66+
}
67+
6168
for note in default_notes {
6269
diag.note(note.clone());
6370
}

tests/ui/attributes/unstable_removed.stderr

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ LL | | link = "https://github.com/rust-lang/rust/issues/141617",
99
LL | | since="1.92.0"
1010
LL | | )]
1111
| |__^
12-
|
13-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
14-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1512

1613
error[E0557]: feature `old_feature` has been removed
1714
--> $DIR/unstable_removed.rs:3:12

tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
33
|
44
LL | #[rustc_const_unstable(feature="fzzzzzt")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
8-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
96

107
error[E0547]: missing 'issue'
118
--> $DIR/feature-gate-rustc_const_unstable.rs:3:1

tests/ui/feature-gates/feature-gate-staged_api.stderr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@ error[E0658]: stability attributes may not be used outside of the standard libra
33
|
44
LL | #![stable(feature = "a", since = "3.3.3")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
8-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
96

107
error[E0658]: stability attributes may not be used outside of the standard library
118
--> $DIR/feature-gate-staged_api.rs:8:1
129
|
1310
LL | #[stable(feature = "a", since = "3.3.3")]
1411
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15-
|
16-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
17-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1812

1913
error: aborting due to 2 previous errors
2014

tests/ui/feature-gates/issue-43106-gating-of-stable.stderr

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
33
|
44
LL | #![stable()]
55
| ^^^^^^^^^^^^
6-
|
7-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
8-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
96

107
error[E0546]: missing 'feature'
118
--> $DIR/issue-43106-gating-of-stable.rs:7:1
@@ -24,9 +21,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
2421
|
2522
LL | #[stable()]
2623
| ^^^^^^^^^^^
27-
|
28-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
29-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3024

3125
error[E0546]: missing 'feature'
3226
--> $DIR/issue-43106-gating-of-stable.rs:12:1
@@ -45,9 +39,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
4539
|
4640
LL | #![stable()]
4741
| ^^^^^^^^^^^^
48-
|
49-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
50-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5142

5243
error[E0546]: missing 'feature'
5344
--> $DIR/issue-43106-gating-of-stable.rs:18:9
@@ -66,9 +57,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
6657
|
6758
LL | #[stable()]
6859
| ^^^^^^^^^^^
69-
|
70-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
71-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
7260

7361
error[E0546]: missing 'feature'
7462
--> $DIR/issue-43106-gating-of-stable.rs:24:5
@@ -87,9 +75,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
8775
|
8876
LL | #[stable()]
8977
| ^^^^^^^^^^^
90-
|
91-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
92-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
9378

9479
error[E0546]: missing 'feature'
9580
--> $DIR/issue-43106-gating-of-stable.rs:30:5
@@ -108,9 +93,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
10893
|
10994
LL | #[stable()]
11095
| ^^^^^^^^^^^
111-
|
112-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
113-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
11496

11597
error[E0546]: missing 'feature'
11698
--> $DIR/issue-43106-gating-of-stable.rs:36:5
@@ -129,9 +111,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
129111
|
130112
LL | #[stable()]
131113
| ^^^^^^^^^^^
132-
|
133-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
134-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
135114

136115
error[E0546]: missing 'feature'
137116
--> $DIR/issue-43106-gating-of-stable.rs:42:5

tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
33
|
44
LL | #![unstable()]
55
| ^^^^^^^^^^^^^^
6-
|
7-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
8-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
96

107
error[E0546]: missing 'feature'
118
--> $DIR/issue-43106-gating-of-unstable.rs:7:1
@@ -24,9 +21,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
2421
|
2522
LL | #[unstable()]
2623
| ^^^^^^^^^^^^^
27-
|
28-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
29-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3024

3125
error[E0546]: missing 'feature'
3226
--> $DIR/issue-43106-gating-of-unstable.rs:12:1
@@ -45,9 +39,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
4539
|
4640
LL | #![unstable()]
4741
| ^^^^^^^^^^^^^^
48-
|
49-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
50-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5142

5243
error[E0546]: missing 'feature'
5344
--> $DIR/issue-43106-gating-of-unstable.rs:18:9
@@ -66,9 +57,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
6657
|
6758
LL | #[unstable()]
6859
| ^^^^^^^^^^^^^
69-
|
70-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
71-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
7260

7361
error[E0546]: missing 'feature'
7462
--> $DIR/issue-43106-gating-of-unstable.rs:24:5
@@ -87,9 +75,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
8775
|
8876
LL | #[unstable()]
8977
| ^^^^^^^^^^^^^
90-
|
91-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
92-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
9378

9479
error[E0546]: missing 'feature'
9580
--> $DIR/issue-43106-gating-of-unstable.rs:30:5
@@ -108,9 +93,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
10893
|
10994
LL | #[unstable()]
11095
| ^^^^^^^^^^^^^
111-
|
112-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
113-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
11496

11597
error[E0546]: missing 'feature'
11698
--> $DIR/issue-43106-gating-of-unstable.rs:36:5
@@ -129,9 +111,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
129111
|
130112
LL | #[unstable()]
131113
| ^^^^^^^^^^^^^
132-
|
133-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
134-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
135114

136115
error[E0546]: missing 'feature'
137116
--> $DIR/issue-43106-gating-of-unstable.rs:42:5

tests/ui/stability-attribute/issue-106589.stderr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@ error[E0658]: stability attributes may not be used outside of the standard libra
33
|
44
LL | #![stable(feature = "foo", since = "1.0.0")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
8-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
96

107
error[E0658]: stability attributes may not be used outside of the standard library
118
--> $DIR/issue-106589.rs:6:1
129
|
1310
LL | #[unstable(feature = "foo", issue = "none")]
1411
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15-
|
16-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
17-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1812

1913
error: aborting due to 2 previous errors
2014

tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
33
|
44
LL | #[unstable()]
55
| ^^^^^^^^^^^^^
6-
|
7-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
8-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
96

107
error[E0546]: missing 'feature'
118
--> $DIR/stability-attribute-non-staged-force-unstable.rs:3:1
@@ -24,9 +21,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
2421
|
2522
LL | #[stable()]
2623
| ^^^^^^^^^^^
27-
|
28-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
29-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3024

3125
error[E0546]: missing 'feature'
3226
--> $DIR/stability-attribute-non-staged-force-unstable.rs:7:1

tests/ui/stability-attribute/stability-attribute-non-staged.stderr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
33
|
44
LL | #[unstable()]
55
| ^^^^^^^^^^^^^
6-
|
7-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
8-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
96

107
error[E0546]: missing 'feature'
118
--> $DIR/stability-attribute-non-staged.rs:1:1
@@ -24,9 +21,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
2421
|
2522
LL | #[stable()]
2623
| ^^^^^^^^^^^
27-
|
28-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
29-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3024

3125
error[E0546]: missing 'feature'
3226
--> $DIR/stability-attribute-non-staged.rs:5:1

tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ error[E0658]: stability attributes may not be used outside of the standard libra
33
|
44
LL | #[unstable_feature_bound(feat_bar)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= help: add `#![feature(staged_api)]` to the crate attributes to enable
8-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
96

107
error: aborting due to 1 previous error
118

0 commit comments

Comments
 (0)