2018-11-24 07:34:13 -06:00
|
|
|
// force-host
|
2016-11-08 05:15:02 -06:00
|
|
|
// no-prefer-dynamic
|
|
|
|
|
|
|
|
#![crate_type = "proc-macro"]
|
|
|
|
|
|
|
|
extern crate proc_macro;
|
|
|
|
|
|
|
|
use proc_macro::TokenStream;
|
|
|
|
|
|
|
|
#[proc_macro_derive(B, attributes(B, C))]
|
|
|
|
pub fn derive(input: TokenStream) -> TokenStream {
|
|
|
|
let input = input.to_string();
|
2020-06-14 06:30:42 -05:00
|
|
|
assert!(input.contains("#[B [arbitrary tokens]]"));
|
2016-11-08 05:15:02 -06:00
|
|
|
assert!(input.contains("struct B {"));
|
|
|
|
assert!(input.contains("#[C]"));
|
|
|
|
"".parse().unwrap()
|
|
|
|
}
|