rust/tests/ui/proc-macro/auxiliary/attr-on-trait.rs
2023-01-11 09:32:08 +00:00

16 lines
318 B
Rust

// force-host
// 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);
assert_eq!(item.to_string(), "fn foo() {}");
"fn foo(&self);".parse().unwrap()
}