4 #![crate_type = "proc-macro"]
6 extern crate proc_macro;
8 use proc_macro::TokenStream;
10 #[proc_macro_derive(B, attributes(B, C))]
11 pub fn derive(input: TokenStream) -> TokenStream {
12 let input = input.to_string();
13 assert!(input.contains("#[B [arbitrary tokens]]"));
14 assert!(input.contains("struct B {"));
15 assert!(input.contains("#[C]"));