2016-10-03 11:49:39 -05:00
|
|
|
#![crate_type = "proc-macro"]
|
2016-09-27 13:19:03 -05:00
|
|
|
|
2016-10-03 11:49:39 -05:00
|
|
|
extern crate proc_macro;
|
2016-09-27 13:19:03 -05:00
|
|
|
|
2016-10-03 11:49:39 -05:00
|
|
|
use proc_macro::TokenStream;
|
2016-09-27 13:19:03 -05:00
|
|
|
|
2016-10-03 11:49:39 -05:00
|
|
|
#[proc_macro_derive(A)]
|
2016-09-27 13:19:03 -05:00
|
|
|
pub fn derive(input: TokenStream) -> TokenStream {
|
|
|
|
let input = input.to_string();
|
2020-06-14 06:30:42 -05:00
|
|
|
assert!(input.contains("struct A ;"));
|
2016-09-27 13:19:03 -05:00
|
|
|
"struct B;".parse().unwrap()
|
|
|
|
}
|