diff options
Diffstat (limited to 'tests/ui/proc-macro/auxiliary/multiple-derives.rs')
-rw-r--r-- | tests/ui/proc-macro/auxiliary/multiple-derives.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/auxiliary/multiple-derives.rs b/tests/ui/proc-macro/auxiliary/multiple-derives.rs new file mode 100644 index 000000000..e3f6607b2 --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/multiple-derives.rs @@ -0,0 +1,22 @@ +// force-host +// no-prefer-dynamic + +#![crate_type = "proc-macro"] + +extern crate proc_macro; + +use proc_macro::TokenStream; + +macro_rules! make_derives { + ($($name:ident),*) => { + $( + #[proc_macro_derive($name)] + pub fn $name(input: TokenStream) -> TokenStream { + println!("Derive {}: {}", stringify!($name), input); + TokenStream::new() + } + )* + } +} + +make_derives!(First, Second, Third, Fourth, Fifth); |