summaryrefslogtreecommitdiffstats
path: root/tests/ui/proc-macro/auxiliary/print-tokens.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/proc-macro/auxiliary/print-tokens.rs')
-rw-r--r--tests/ui/proc-macro/auxiliary/print-tokens.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/auxiliary/print-tokens.rs b/tests/ui/proc-macro/auxiliary/print-tokens.rs
new file mode 100644
index 000000000..3a5767edb
--- /dev/null
+++ b/tests/ui/proc-macro/auxiliary/print-tokens.rs
@@ -0,0 +1,16 @@
+// 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()
+}