1 #![deny(unused_macro_rules)]
2 // To make sure we are not hitting this
3 #![deny(unused_macros)]
7 // Most simple (and common) case
8 (two) => { compile_error!("foo"); };
10 (two_) => { foo(compile_error!("foo")); };
12 (four) => { 4 }; //~ ERROR: rule of macro
14 const _NUM: u8 = num!(one) + num!(three);
16 // compile_error not used as a macro invocation
19 // Only identifier present
20 (two) => { fn compile_error() {} }; //~ ERROR: rule of macro
21 // Only identifier and bang present
22 (two_) => { compile_error! }; //~ ERROR: rule of macro
25 const _NUM2: u8 = num2!(one) + num2!(three);