rust/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs
2024-02-16 20:02:50 +00:00

17 lines
321 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);
}
}