rust/tests/ui/proc-macro/auxiliary/print-tokens.rs

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

17 lines
323 B
Rust
Raw Normal View History

//@ force-host
//@ no-prefer-dynamic
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::{TokenStream, TokenTree};
#[proc_macro]
pub fn print_tokens(input: TokenStream) -> TokenStream {
println!("{:#?}", input);
for token in input {
println!("{token}");
}
TokenStream::new()
}