2022-12-29 17:14:29 -06:00
|
|
|
// check-fail
|
|
|
|
// compile-flags: -Z tiny-const-eval-limit
|
2022-12-19 18:51:17 -06:00
|
|
|
|
2022-11-02 06:57:40 -05:00
|
|
|
#[rustfmt::skip]
|
2022-12-19 18:51:17 -06:00
|
|
|
const fn recurse(n: u32) -> u32 {
|
|
|
|
if n == 0 {
|
|
|
|
n
|
|
|
|
} else {
|
2022-11-02 06:57:40 -05:00
|
|
|
recurse(n - 1) //~ ERROR is taking a long time
|
2022-12-19 18:51:17 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-29 17:14:29 -06:00
|
|
|
const X: u32 = recurse(19);
|
2022-12-19 18:51:17 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("{X}");
|
|
|
|
}
|