about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-10-03 16:25:47 -0700
committerGitHub <noreply@github.com>2019-10-03 16:25:47 -0700
commitdd9ccb20fc1de307f4441d239f77fb7d6990b2c3 (patch)
treed18a5efcb25191912b1acda51c16a8d5234d4a73 /src/libsyntax
parent211bc4a6873a9f6c7686eb25c26c91fbec09e9ca (diff)
parent1d49f9a10a4ed31ddafce65c2a57a2a177ac2cde (diff)
downloadrust-dd9ccb20fc1de307f4441d239f77fb7d6990b2c3.tar.gz
rust-dd9ccb20fc1de307f4441d239f77fb7d6990b2c3.zip
Rollup merge of #65055 - GuillaumeGomez:long-err-explanation-E0556, r=petrochenkov
Add long error explanation for E0556

Part of #61137
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/error_codes.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/libsyntax/error_codes.rs b/src/libsyntax/error_codes.rs
index 8a78daee6e4..c0963026945 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