mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
19 lines
497 B
Rust
19 lines
497 B
Rust
// force-host
|
|
|
|
#[macro_export]
|
|
macro_rules! make_it {
|
|
($name:ident) => {
|
|
#[proc_macro]
|
|
pub fn $name(input: TokenStream) -> TokenStream {
|
|
println!("Def site: {:?}", Span::def_site());
|
|
println!("Input: {:?}", input);
|
|
let new: TokenStream = input.into_iter().map(|mut t| {
|
|
t.set_span(Span::def_site());
|
|
t
|
|
}).collect();
|
|
println!("Respanned: {:?}", new);
|
|
new
|
|
}
|
|
};
|
|
}
|