@@ -571,9 +571,6 @@ struct Liveness<'a, 'tcx: 'a> {
571
571
// it probably doesn't now)
572
572
break_ln : NodeMap < LiveNode > ,
573
573
cont_ln : NodeMap < LiveNode > ,
574
-
575
- // mappings from node ID to LiveNode for "breakable" blocks-- currently only `catch {...}`
576
- breakable_block_ln : NodeMap < LiveNode > ,
577
574
}
578
575
579
576
impl < ' a , ' tcx > Liveness < ' a , ' tcx > {
@@ -601,7 +598,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
601
598
users : vec ! [ invalid_users( ) ; num_live_nodes * num_vars] ,
602
599
break_ln : NodeMap ( ) ,
603
600
cont_ln : NodeMap ( ) ,
604
- breakable_block_ln : NodeMap ( ) ,
605
601
}
606
602
}
607
603
@@ -870,7 +866,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
870
866
fn propagate_through_block ( & mut self , blk : & hir:: Block , succ : LiveNode )
871
867
-> LiveNode {
872
868
if blk. targeted_by_break {
873
- self . breakable_block_ln . insert ( blk. id , succ) ;
869
+ self . break_ln . insert ( blk. id , succ) ;
874
870
}
875
871
let succ = self . propagate_through_opt_expr ( blk. expr . as_ref ( ) . map ( |e| & * * e) , succ) ;
876
872
blk. stmts . iter ( ) . rev ( ) . fold ( succ, |succ, stmt| {
@@ -1055,12 +1051,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1055
1051
hir:: ExprBreak ( label, ref opt_expr) => {
1056
1052
// Find which label this break jumps to
1057
1053
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) ) =>
1063
- span_bug ! ( expr. span, "loop scope error: {}" , err) ,
1054
+ Ok ( node_id) => self . break_ln . get ( & node_id) ,
1055
+ Err ( err) => span_bug ! ( expr. span, "loop scope error: {}" , err) ,
1064
1056
} . map ( |x| * x) ;
1065
1057
1066
1058
// Now that we know the label we're going to,
@@ -1075,10 +1067,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1075
1067
hir:: ExprAgain ( label) => {
1076
1068
// Find which label this expr continues to
1077
1069
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) ) =>
1081
- span_bug ! ( expr. span, "loop scope error: {}" , err) ,
1070
+ Ok ( node_id) => node_id,
1071
+ Err ( err) => span_bug ! ( expr. span, "loop scope error: {}" , err) ,
1082
1072
} ;
1083
1073
1084
1074
// Now that we know the label we're going to,
0 commit comments