diff options
Diffstat (limited to 'tests/ui/proc-macro/auxiliary/nested-macro-rules.rs')
-rw-r--r-- | tests/ui/proc-macro/auxiliary/nested-macro-rules.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/auxiliary/nested-macro-rules.rs b/tests/ui/proc-macro/auxiliary/nested-macro-rules.rs new file mode 100644 index 000000000..27676a5cb --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/nested-macro-rules.rs @@ -0,0 +1,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); |