]> git.proxmox.com Git - rustc.git/blob - src/test/ui/proc-macro/nested-nonterminal-tokens.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / proc-macro / nested-nonterminal-tokens.rs
1 // check-pass
2 // edition:2018
3 // compile-flags: -Z span-debug
4 // aux-build:test-macros.rs
5
6 // Tests that we properly pass tokens to proc-macro when nested
7 // nonterminals are involved.
8
9 #![no_std] // Don't load unnecessary hygiene information from std
10 extern crate std;
11
12 #[macro_use]
13 extern crate test_macros;
14
15
16 macro_rules! wrap {
17 (first, $e:expr) => { wrap!(second, $e + 1) };
18 (second, $e:expr) => { wrap!(third, $e + 2) };
19 (third, $e:expr) => {
20 print_bang!($e + 3)
21 };
22 }
23
24 fn main() {
25 let _ = wrap!(first, 0);
26 }