Rollup merge of #57302 - sinkuu:unused_assignments_fp, r=estebank

Fix unused_assignments false positive

Fixes #22630.

In liveness analysis, make `continue` jump to the loop condition's `LiveNode` (`cond` as in comment) instead of the loop's one (`expr`).

069b0c4108/src/librustc/middle/liveness.rs (L1358-L1370)
This commit is contained in:
Mazdak Farrokhzad 2019-01-18 22:56:39 +01:00 committed by GitHub
commit 0dd4bfa356
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 23 deletions

View file

@ -27,4 +27,13 @@ fn f5(mut x: i32) {
x = 4; //~ ERROR: value assigned to `x` is never read
}
// #22630
fn f6() {
let mut done = false;
while !done {
done = true; // no error
continue;
}
}
fn main() {}