about summary refs log tree commit diff
path: root/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs')
-rw-r--r--tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs25
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs
index 47418b4e091..df87a3d846e 100644
--- a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs
+++ b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs
@@ -1,16 +1,24 @@
-#[cfg] //~ ERROR `cfg` is not followed by parentheses
+#[cfg]
+//~^ ERROR malformed `cfg` attribute
+//~| NOTE expected this to be a list
 struct S1;
 
-#[cfg = 10] //~ ERROR `cfg` is not followed by parentheses
+#[cfg = 10]
+//~^ ERROR malformed `cfg` attribute
+//~| NOTE expected this to be a list
 struct S2;
 
-#[cfg()] //~ ERROR `cfg` predicate is not specified
+#[cfg()]
+//~^ ERROR malformed `cfg` attribute
+//~| NOTE expected a single argument here
 struct S3;
 
-#[cfg(a, b)] //~ ERROR multiple `cfg` predicates are specified
+#[cfg(a, b)]
+//~^ ERROR malformed `cfg` attribute
+//~| NOTE expected a single argument here
 struct S4;
 
-#[cfg("str")] //~ ERROR `cfg` predicate key cannot be a literal
+#[cfg("str")] //~ ERROR `cfg` predicate key must be an identifier
 struct S5;
 
 #[cfg(a::b)] //~ ERROR `cfg` predicate key must be an identifier
@@ -19,10 +27,12 @@ struct S6;
 #[cfg(a())] //~ ERROR invalid predicate `a`
 struct S7;
 
-#[cfg(a = 10)] //~ ERROR literal in `cfg` predicate value must be a string
+#[cfg(a = 10)] //~ ERROR malformed `cfg` attribute input
+//~^ NOTE expected a string literal here
 struct S8;
 
-#[cfg(a = b"hi")]  //~ ERROR literal in `cfg` predicate value must be a string
+#[cfg(a = b"hi")]  //~ ERROR malformed `cfg` attribute input
+//~^ NOTE expected a normal string literal, not a byte string literal
 struct S9;
 
 macro_rules! generate_s10 {
@@ -34,5 +44,6 @@ macro_rules! generate_s10 {
 }
 
 generate_s10!(concat!("nonexistent"));
+//~^ NOTE in this expansion of generate_s10!
 
 fn main() {}