about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-07-03 16:58:43 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2016-07-11 23:24:49 +0200
commited2bf577280e2dd4a7a18c1048d9408b30051cd6 (patch)
tree9b09bf53479393bcb3d676ef8f4ad662141239c9 /src/libsyntax
parentebebb3164a0872016d68ff2b7a0fd73bab3ea465 (diff)
downloadrust-ed2bf577280e2dd4a7a18c1048d9408b30051cd6.tar.gz
rust-ed2bf577280e2dd4a7a18c1048d9408b30051cd6.zip
Add E0537 error explanation
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/diagnostic_list.rs32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs
index dfec5a43cde..d19fd300886 100644
--- a/src/libsyntax/diagnostic_list.rs
+++ b/src/libsyntax/diagnostic_list.rs
@@ -128,10 +128,40 @@ For more information about the cfg attribute, take a look here:
 https://doc.rust-lang.org/reference.html#conditional-compilation
 "##,
 
+E0537: r##"
+A unknown predicate was used inside the cfg attribute.
+
+Erroneous code example:
+
+```compile_fail,E0537
+#[cfg(unknown())] // error: invalid predicate `unknown`
+pub fn something() {}
+
+pub fn main() {}
+```
+
+There are only three predicates for the cfg attribute:
+
+ * any
+ * all
+ * not
+
+Example:
+
+```
+#[cfg(not(target_os = "linux"))] // ok!
+pub fn something() {}
+
+pub fn main() {}
+```
+
+For more information about the cfg attribute, take a look here:
+https://doc.rust-lang.org/reference.html#conditional-compilation
+"##,
+
 }
 
 register_diagnostics! {
-    E0537, // invalid predicate
     E0538, // multiple [same] items
     E0539, // incorrect meta item
     E0540, // multiple rustc_deprecated attributes