blob: 7730f91bd6a0378f73a89d3ed92eb0611603e149 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// force-host
// no-prefer-dynamic
#![feature(proc_macro_quote)]
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::{TokenStream, quote};
#[proc_macro]
pub fn make_it(input: TokenStream) -> TokenStream {
// `quote!` applies def-site hygiene
quote! {
trait Foo {
fn my_fn(&self) {}
}
impl<T> Foo for T {}
"a".my_fn();
}
}
|