2018-11-24 07:34:13 -06:00
|
|
|
// force-host
|
2017-08-25 15:33:15 -05:00
|
|
|
// no-prefer-dynamic
|
|
|
|
|
|
|
|
#![crate_type = "proc-macro"]
|
|
|
|
|
|
|
|
extern crate proc_macro;
|
|
|
|
|
|
|
|
use proc_macro::TokenStream;
|
|
|
|
|
|
|
|
#[proc_macro_attribute]
|
|
|
|
pub fn foo(attr: TokenStream, item: TokenStream) -> TokenStream {
|
|
|
|
drop(attr);
|
2021-12-01 13:45:14 -06:00
|
|
|
assert_eq!(item.to_string(), "fn foo() {}");
|
2017-08-25 15:33:15 -05:00
|
|
|
"fn foo(&self);".parse().unwrap()
|
|
|
|
}
|