]>
Commit | Line | Data |
---|---|---|
a1dfa0c6 | 1 | // force-host |
476ff2be SL |
2 | // no-prefer-dynamic |
3 | ||
c30ab7b3 | 4 | #![crate_type = "proc-macro"] |
3157f602 | 5 | |
c30ab7b3 | 6 | extern crate proc_macro; |
5bcae85e | 7 | |
476ff2be | 8 | use proc_macro::TokenStream; |
5bcae85e | 9 | |
476ff2be SL |
10 | #[proc_macro_derive(B, attributes(B, C))] |
11 | pub fn derive(input: TokenStream) -> TokenStream { | |
12 | let input = input.to_string(); | |
f035d41b | 13 | assert!(input.contains("#[B [arbitrary tokens]]")); |
476ff2be SL |
14 | assert!(input.contains("struct B {")); |
15 | assert!(input.contains("#[C]")); | |
476ff2be | 16 | "".parse().unwrap() |
a7813a04 | 17 | } |