rust/tests/ui/proc-macro/auxiliary/print-tokens.rs
2023-09-24 20:24:33 +00:00

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