]> git.lizzy.rs Git - rust.git/commitdiff
Add E0537 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 3 Jul 2016 14:58:43 +0000 (16:58 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 11 Jul 2016 21:24:49 +0000 (23:24 +0200)
src/libsyntax/diagnostic_list.rs

index dfec5a43cdeed62257bbb64c18b158327cc48408..d19fd300886cd714d4d2a97a5d3c2d6e742ee6d2 100644 (file)
@@ -128,10 +128,40 @@ pub fn main() {}
 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