Skip to content

Commit e86af1b

Browse files
Add long error explanation for E0556
1 parent 42ec683 commit e86af1b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
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

0 commit comments

Comments
 (0)