rust/tests/ui/proc-macro/auxiliary/nested-macro-rules.rs

17 lines
404 B
Rust
Raw Normal View History

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);