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
|
|
|
|
|
|
|
const fn recurse(n: u32) -> u32 {
|
|
|
|
if n == 0 {
|
|
|
|
n
|
|
|
|
} else {
|
2022-12-29 17:14:29 -06:00
|
|
|
recurse(n - 1) //~ ERROR evaluation of constant value failed [E0080]
|
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}");
|
|
|
|
}
|