1 // run-pass 2 3 macro_rules! compiles_fine { 4 (#[$at:meta]) => { 5 // test that the different types of attributes work 6 #[attribute] 7 /// Documentation! 8 #[$at] 9 10 // check that the attributes are recognised by requiring this 11 // to be removed to avoid a compile error 12 #[cfg(always_remove)] 13 static MISTYPED: () = "foo"; 14 } 15 } 16 17 // item 18 compiles_fine!(#[foo]); 19 main()20pub fn main() { 21 // statement 22 compiles_fine!(#[bar]); 23 } 24