@@ -571,9 +571,6 @@ struct Liveness<'a, 'tcx: 'a> {
571571 // it probably doesn't now)
572572 break_ln : NodeMap < LiveNode > ,
573573 cont_ln : NodeMap < LiveNode > ,
574-
575- // mappings from node ID to LiveNode for "breakable" blocks-- currently only `catch {...}`
576- breakable_block_ln : NodeMap < LiveNode > ,
577574}
578575
579576impl < ' a , ' tcx > Liveness < ' a , ' tcx > {
@@ -601,7 +598,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
601598 users : vec ! [ invalid_users( ) ; num_live_nodes * num_vars] ,
602599 break_ln : NodeMap ( ) ,
603600 cont_ln : NodeMap ( ) ,
604- breakable_block_ln : NodeMap ( ) ,
605601 }
606602 }
607603
@@ -870,7 +866,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
870866 fn propagate_through_block ( & mut self , blk : & hir:: Block , succ : LiveNode )
871867 -> LiveNode {
872868 if blk. targeted_by_break {
873- self . breakable_block_ln . insert ( blk. id , succ) ;
869+ self . break_ln . insert ( blk. id , succ) ;
874870 }
875871 let succ = self . propagate_through_opt_expr ( blk. expr . as_ref ( ) . map ( |e| & * * e) , succ) ;
876872 blk. stmts . iter ( ) . rev ( ) . fold ( succ, |succ, stmt| {
@@ -1055,11 +1051,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
10551051 hir:: ExprBreak ( label, ref opt_expr) => {
10561052 // Find which label this break jumps to
10571053 let target = match label. target_id {
1058- hir:: ScopeTarget :: Block ( node_id) =>
1059- self . breakable_block_ln . get ( & node_id) ,
1060- hir:: ScopeTarget :: Loop ( hir:: LoopIdResult :: Ok ( node_id) ) =>
1061- self . break_ln . get ( & node_id) ,
1062- hir:: ScopeTarget :: Loop ( hir:: LoopIdResult :: Err ( err) ) =>
1054+ hir:: LoopIdResult :: Ok ( node_id) => self . break_ln . get ( & node_id) ,
1055+ hir:: LoopIdResult :: Err ( err) =>
10631056 span_bug ! ( expr. span, "loop scope error: {}" , err) ,
10641057 } . map ( |x| * x) ;
10651058
@@ -1075,9 +1068,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
10751068 hir:: ExprAgain ( label) => {
10761069 // Find which label this expr continues to
10771070 let sc = match label. target_id {
1078- hir:: ScopeTarget :: Block ( _) => bug ! ( "can't `continue` to a non-loop block" ) ,
1079- hir:: ScopeTarget :: Loop ( hir:: LoopIdResult :: Ok ( node_id) ) => node_id,
1080- hir:: ScopeTarget :: Loop ( hir:: LoopIdResult :: Err ( err) ) =>
1071+ hir:: LoopIdResult :: Ok ( node_id) => node_id,
1072+ hir:: LoopIdResult :: Err ( err) =>
10811073 span_bug ! ( expr. span, "loop scope error: {}" , err) ,
10821074 } ;
10831075
0 commit comments