rust/tests/ui/proc-macro/auxiliary/print-tokens.rs
2024-02-16 20:02:50 +00:00

17 lines
323 B
Rust

//@ 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()
}