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

Add long error explanation for E0556 #65055

Merged
merged 2 commits into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 19 additions & 1 deletion src/libsyntax/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,25 @@ If you need the feature, make sure to use a nightly release of the compiler
(but be warned that the feature may be removed or altered in the future).
"##,

E0556: r##"
The `feature` attribute was badly formed.

Erroneous code example:

```compile_fail,E0556
#![feature(foo_bar_baz, foo(bar), foo = "baz", foo)] // error!
#![feature] // error!
#![feature = "foo"] // error!
```

The `feature` attribute only accept a "feature flag" and can only be used on
nightly. Example:

```ignore (only works in nightly)
#![feature(flag)]
```
"##,

E0557: r##"
A feature attribute named a feature that has been removed.

Expand Down Expand Up @@ -457,7 +476,6 @@ features in the `-Z allow_features` flag.
E0551, // incorrect meta item
E0553, // multiple rustc_const_unstable attributes
// E0555, // replaced with a generic attribute input check
E0556, // malformed feature, expected just one word
E0584, // file for module `..` found at both .. and ..
E0629, // missing 'feature' (rustc_const_unstable)
// rustc_const_unstable attribute must be paired with stable/unstable
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/gated-bad-feature.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ LL | #![feature = "foo"]

error: aborting due to 5 previous errors

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