From ebebb3164a0872016d68ff2b7a0fd73bab3ea465 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 3 Jul 2016 16:53:17 +0200 Subject: [PATCH] Add E0536 error explanation --- src/libsyntax/diagnostic_list.rs | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs index beaf4ab5cdd0..dfec5a43cdee 100644 --- a/src/libsyntax/diagnostic_list.rs +++ b/src/libsyntax/diagnostic_list.rs @@ -69,7 +69,7 @@ fn main() {} ``` For more information about the inline attribute, take a look here: -https://doc.rust-lang.org/reference.html#inline-attributes) +https://doc.rust-lang.org/reference.html#inline-attributes "##, E0535: r##" @@ -100,13 +100,37 @@ fn main() {} ``` For more information about the inline attribute, take a look here: -https://doc.rust-lang.org/reference.html#inline-attributes) +https://doc.rust-lang.org/reference.html#inline-attributes +"##, + +E0536: r##" +No cfg-pattern was found for `not` statement. + +Erroneous code example: + +```compile_fail,E0536 +#[cfg(not())] // error: expected 1 cfg-pattern +pub fn something() {} + +pub fn main() {} +``` + +The `not` statement expects at least one cfg-pattern. 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! { - E0536, // expected 1 cfg-pattern E0537, // invalid predicate E0538, // multiple [same] items E0539, // incorrect meta item