rust/tests/ui/proc-macro/auxiliary/multiple-derives.rs
2023-01-11 09:32:08 +00:00

23 lines
482 B
Rust

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