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
Metadata
Metadata
Assignees
Labels
Area: Type systemCategory: This is a bug.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessMedium priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.