summaryrefslogtreecommitdiffstats
path: root/tests/ui/proc-macro/auxiliary/nested-macro-rules.rs
blob: 27676a5cb8112e2a3a077d4f6279fd020ad38bbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub struct FirstStruct;

#[macro_export]
macro_rules! outer_macro {
    ($name:ident, $attr_struct_name:ident) => {
        #[macro_export]
        macro_rules! inner_macro {
            ($bang_macro:ident, $attr_macro:ident) => {
                $bang_macro!($name);
                #[$attr_macro] struct $attr_struct_name {}
            }
        }
    }
}

outer_macro!(FirstStruct, FirstAttrStruct);