How does the compiler deal with const functions that take too long to evaluate at compile time?
Seems there is no warning - but I assume it tries to evaluate them and then gives up if they do not complete in a finite number of steps?
Where is the limit?
const fn eval() -> usize {
let i = 1;
while i < 5 {}
i
}
fn main() {
let x = eval();
println!("Hello, world! {}", x);
}
But note that your given code will compile and then loop forever at run time, because you didn't call eval in a compile-time context. Hence the change in my playground: