]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/issue-16098.rs
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
[rust.git] / tests / ui / macros / issue-16098.rs
1 macro_rules! prob1 {
2     (0) => {
3         0
4     };
5     ($n:expr) => {
6         if ($n % 3 == 0) || ($n % 5 == 0) {
7             $n + prob1!($n - 1); //~ ERROR recursion limit reached while expanding `prob1!`
8         } else {
9             prob1!($n - 1);
10         }
11     };
12 }
13
14 fn main() {
15     println!("Problem 1: {}", prob1!(1000));
16 }