Closed
Description
Having the following main function results in an illigal instruction on stable, beta and nighlty.
It should be noted that when n
is not used after the loop, the illigal instruction does not occur
https://play.rust-lang.org/?gist=96a11fd41327de4bf4e2c371dd7c1660&version=stable&mode=debug
fn main() {
let mut n = 0;
'a: while {break 'a; true} {
n += 1;
}
n += 2;
}
Interestingly putting the same while-loop in a function works fine:
https://play.rust-lang.org/?gist=ed60d2118b970be39e09bc8653a25345&version=stable&mode=debug