@@ -911,7 +911,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
911911 }
912912
913913 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
915915 // effectively a return---this only occurs in `for` loops,
916916 // where the body is really a closure.
917917
@@ -1407,15 +1407,16 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
14071407 debug ! ( "propagate_through_loop: using id for loop body {} {}" ,
14081408 expr. id, self . ir. tcx. hir( ) . node_to_pretty_string( body. id) ) ;
14091409
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) ;
14141412
14151413 let cond_ln = match kind {
14161414 LoopLoop => ln,
14171415 WhileLoop ( ref cond) => self . propagate_through_expr ( & cond, ln) ,
14181416 } ;
1417+
1418+ self . cont_ln . insert ( expr. id , cond_ln) ;
1419+
14191420 let body_ln = self . propagate_through_block ( body, cond_ln) ;
14201421
14211422 // repeat until fixed point is reached:
0 commit comments