rust/tests/ui/proc-macro/auxiliary/generate-dollar-ident.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
319 B
Rust
Raw Normal View History

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