@@ -911,7 +911,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
911
911
}
912
912
913
913
fn compute ( & mut self , body : & hir:: Expr ) -> LiveNode {
914
- // if there is a `break` or `again ` at the top level, then it's
914
+ // if there is a `break` or `continue ` at the top level, then it's
915
915
// effectively a return---this only occurs in `for` loops,
916
916
// where the body is really a closure.
917
917
@@ -1407,15 +1407,16 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1407
1407
debug ! ( "propagate_through_loop: using id for loop body {} {}" ,
1408
1408
expr. id, self . ir. tcx. hir( ) . node_to_pretty_string( body. id) ) ;
1409
1409
1410
- let break_ln = succ;
1411
- let cont_ln = ln;
1412
- self . break_ln . insert ( expr. id , break_ln) ;
1413
- self . cont_ln . insert ( expr. id , cont_ln) ;
1410
+
1411
+ self . break_ln . insert ( expr. id , succ) ;
1414
1412
1415
1413
let cond_ln = match kind {
1416
1414
LoopLoop => ln,
1417
1415
WhileLoop ( ref cond) => self . propagate_through_expr ( & cond, ln) ,
1418
1416
} ;
1417
+
1418
+ self . cont_ln . insert ( expr. id , cond_ln) ;
1419
+
1419
1420
let body_ln = self . propagate_through_block ( body, cond_ln) ;
1420
1421
1421
1422
// repeat until fixed point is reached:
0 commit comments