]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/macro-attributes.rs
Rollup merge of #106962 - compiler-errors:use-sugg-span, r=oli-obk
[rust.git] / tests / ui / macros / macro-attributes.rs
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
20 pub fn main() {
21     // statement
22     compiles_fine!(#[bar]);
23 }