diff options
Diffstat (limited to 'tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs')
-rw-r--r-- | tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs b/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs new file mode 100644 index 000000000..3f3e12eed --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs @@ -0,0 +1,16 @@ +// force-host +// no-prefer-dynamic + +#![feature(proc_macro_quote)] +#![crate_type = "proc-macro"] + +extern crate proc_macro; +use proc_macro::*; + +#[proc_macro] +pub fn dollar_ident(input: TokenStream) -> TokenStream { + let black_hole = input.into_iter().next().unwrap(); + quote! { + $black_hole!($$var); + } +} |