]> git.lizzy.rs Git - rust.git/blob - src/test/ui/auxiliary/hello_macro.rs
Merge commit 'cd4810de42c57b64b74dae09c530a4c3a41f87b9' into libgccjit-codegen
[rust.git] / src / test / ui / auxiliary / hello_macro.rs
1 // force-host
2 // no-prefer-dynamic
3
4 #![crate_type = "proc-macro"]
5 #![feature(proc_macro_quote)]
6
7 extern crate proc_macro;
8
9 use proc_macro::{TokenStream, quote};
10
11 // This macro is not very interesting, but it does contain delimited tokens with
12 // no content - `()` and `{}` - which has caused problems in the past.
13 // Also, it tests that we can escape `$` via `$$`.
14 #[proc_macro]
15 pub fn hello(_: TokenStream) -> TokenStream {
16     quote!({
17         fn hello() {}
18         macro_rules! m { ($$($$t:tt)*) => { $$($$t)* } }
19         m!(hello());
20     })
21 }