From e86af1bbeb610423a4d6c56e6da5ceb411d6b53c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 3 Oct 2019 14:11:31 +0200 Subject: [PATCH 1/2] Add long error explanation for E0556 --- src/libsyntax/error_codes.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/libsyntax/error_codes.rs b/src/libsyntax/error_codes.rs index 8a78daee6e49b..c0963026945b0 100644 --- a/src/libsyntax/error_codes.rs +++ b/src/libsyntax/error_codes.rs @@ -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. @@ -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 From 1d49f9a10a4ed31ddafce65c2a57a2a177ac2cde Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 3 Oct 2019 14:11:39 +0200 Subject: [PATCH 2/2] update ui tests --- src/test/ui/gated-bad-feature.stderr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/ui/gated-bad-feature.stderr b/src/test/ui/gated-bad-feature.stderr index ff6780e66a8ce..79e59f76311fd 100644 --- a/src/test/ui/gated-bad-feature.stderr +++ b/src/test/ui/gated-bad-feature.stderr @@ -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`.