]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/issue-79242-slow-retokenize-check.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / proc-macro / issue-79242-slow-retokenize-check.rs
1 // check-pass
2 // aux-build:issue-79242.rs
3
4 // Regression test for issue #79242
5 // Tests that compilation time doesn't blow up for a proc-macro
6 // invocation with deeply nested nonterminals
7
8 #![allow(unused)]
9
10 extern crate issue_79242;
11
12 macro_rules! declare_nats {
13     ($prev:ty) => {};
14     ($prev:ty, $n:literal$(, $tail:literal)*) => {
15
16         issue_79242::dummy! {
17             $prev
18         }
19
20         declare_nats!(Option<$prev>$(, $tail)*);
21     };
22     (0, $($n:literal),+) => {
23         pub struct N0;
24         declare_nats!(N0, $($n),+);
25     };
26 }
27
28 declare_nats! {
29     0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
30     17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
31 }
32
33
34 fn main() {}