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