1 // aux-build:test-macros.rs
2 // gate-test-proc_macro_hygiene
4 #![feature(stmt_expr_attributes)]
7 extern crate test_macros;
10 #![empty_attr] //~ ERROR: non-builtin inner attributes are unstable
13 #[empty_attr] //~ ERROR: custom attributes cannot be applied to modules
17 #![empty_attr] //~ ERROR: custom attributes cannot be applied to modules
18 //~| ERROR: non-builtin inner attributes are unstable
21 #[empty_attr = "y"] //~ ERROR: must only be followed by a delimiter token
30 #[empty_attr] //~ ERROR: custom attributes cannot be applied to statements
34 #[empty_attr] //~ ERROR: custom attributes cannot be applied to statements
38 #[empty_attr] //~ ERROR: custom attributes cannot be applied to statements
42 let _x = #[identity_attr] 2; //~ ERROR: custom attributes cannot be applied to expressions
45 let _x = [#[identity_attr] 2]; //~ ERROR: custom attributes cannot be applied to expressions
48 let _x = #[identity_attr] println!();
49 //~^ ERROR: custom attributes cannot be applied to expressions
53 let _x: identity!(u32) = 3; //~ ERROR: procedural macros cannot be expanded to types
54 if let identity!(Some(_x)) = Some(3) {}
55 //~^ ERROR: procedural macros cannot be expanded to patterns
57 empty!(struct S;); //~ ERROR: procedural macros cannot be expanded to statements
58 empty!(let _x = 3;); //~ ERROR: procedural macros cannot be expanded to statements
60 let _x = identity!(3); //~ ERROR: procedural macros cannot be expanded to expressions
61 let _x = [empty!(3)]; //~ ERROR: procedural macros cannot be expanded to expressions