mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
16 lines
320 B
Rust
16 lines
320 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()
|
|
}
|