Skip to content

Commit c086b9f

Browse files
authored
Rollup merge of #65055 - GuillaumeGomez:long-err-explanation-E0556, r=petrochenkov
Add long error explanation for E0556 Part of #61137
2 parents 6d6a3fb + 1d49f9a commit c086b9f

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/libsyntax/error_codes.rs

+19-1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,25 @@ If you need the feature, make sure to use a nightly release of the compiler
208208
(but be warned that the feature may be removed or altered in the future).
209209
"##,
210210

211+
E0556: r##"
212+
The `feature` attribute was badly formed.
213+
214+
Erroneous code example:
215+
216+
```compile_fail,E0556
217+
#![feature(foo_bar_baz, foo(bar), foo = "baz", foo)] // error!
218+
#![feature] // error!
219+
#![feature = "foo"] // error!
220+
```
221+
222+
The `feature` attribute only accept a "feature flag" and can only be used on
223+
nightly. Example:
224+
225+
```ignore (only works in nightly)
226+
#![feature(flag)]
227+
```
228+
"##,
229+
211230
E0557: r##"
212231
A feature attribute named a feature that has been removed.
213232
@@ -457,7 +476,6 @@ features in the `-Z allow_features` flag.
457476
E0551, // incorrect meta item
458477
E0553, // multiple rustc_const_unstable attributes
459478
// E0555, // replaced with a generic attribute input check
460-
E0556, // malformed feature, expected just one word
461479
E0584, // file for module `..` found at both .. and ..
462480
E0629, // missing 'feature' (rustc_const_unstable)
463481
// rustc_const_unstable attribute must be paired with stable/unstable

src/test/ui/gated-bad-feature.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ LL | #![feature = "foo"]
3030

3131
error: aborting due to 5 previous errors
3232

33-
For more information about this error, try `rustc --explain E0557`.
33+
Some errors have detailed explanations: E0556, E0557.
34+
For more information about an error, try `rustc --explain E0556`.

0 commit comments

Comments
 (0)