Closed
Description
If you put a break
in the condition of a while-loop, the compiler code seems to exhibit undefined behaviour.
For example, in play.rust-lang.org
, this SIGILL-s when -O0
and prints 5 blank lines when -O2
:
fn main() {
for _ in 0..5 {
while { break; } { println!("never"); }
println!("?");
}
}