rust/tests/ui/hygiene/auxiliary/opaque-hygiene.rs
2023-01-11 09:32:08 +00:00

22 lines
401 B
Rust

// 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();
}
}