summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/stable-metric/ctfe-recursion.rs
blob: 56a39fc45b0aee869b2862de5bf1e2bbbd3a0642 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// check-fail
// compile-flags: -Z tiny-const-eval-limit

#[rustfmt::skip]
const fn recurse(n: u32) -> u32 {
    if n == 0 {
        n
    } else {
        recurse(n - 1) //~ ERROR is taking a long time
    }
}

const X: u32 = recurse(19);

fn main() {
    println!("{X}");
}