rust/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs
2023-01-11 09:32:08 +00:00

17 lines
319 B
Rust

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