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

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