mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
16 lines
318 B
Rust
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()
|
|
}
|