rust/tests/ui/hygiene/auxiliary/use_by_macro.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
252 B
Rust
Raw Normal View History

2021-10-23 06:06:58 -05:00
#![feature(decl_macro)]
macro x($macro_name:ident) {
#[macro_export]
macro_rules! $macro_name {
(define) => {
pub struct MyStruct;
};
(create) => {
MyStruct {}
};
}
}
x!(my_struct);