@@ -1071,12 +1071,8 @@ pub(crate) struct MatchAutomatonStep<'a, 'c, 'pat, 'tcx> {
10711071 place : PlaceBuilder < ' tcx > ,
10721072 /// ... depending on the result, branch to one of these candidate lists...
10731073 target_candidates : Vec < Vec < & ' a mut Candidate < ' pat , ' tcx > > > ,
1074- /// ... if it doesn't match, continue with these...
1074+ /// ... if it doesn't match, continue with these.
10751075 remaining_candidates : & ' a mut [ & ' c mut Candidate < ' pat , ' tcx > ] ,
1076- /// ... and if nothing matches, continue to this block.
1077- otherwise_block : & ' a mut Option < BasicBlock > ,
1078- /// Track places that need fake borrows.
1079- fake_borrows : & ' a mut Option < FxIndexSet < Place < ' tcx > > > ,
10801076}
10811077
10821078impl < ' b , ' c , ' pat , ' tcx > std:: fmt:: Debug for MatchAutomatonStep < ' b , ' c , ' pat , ' tcx > {
@@ -1414,8 +1410,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
14141410 match first_candidate. match_pairs [ 0 ] . pattern . kind {
14151411 PatKind :: Or { .. } => ( ) ,
14161412 _ => {
1417- let step = self . build_test_step ( candidates, otherwise_block , fake_borrows) ;
1418- self . perform_test ( span, scrutinee_span, block, step) ;
1413+ let step = self . build_test_step ( candidates, fake_borrows) ;
1414+ self . perform_test ( span, scrutinee_span, block, otherwise_block , fake_borrows , step) ;
14191415 return ;
14201416 }
14211417 }
@@ -1648,8 +1644,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
16481644 fn build_test_step < ' pat , ' b , ' c > (
16491645 & mut self ,
16501646 mut candidates : & ' b mut [ & ' c mut Candidate < ' pat , ' tcx > ] ,
1651- otherwise_block : & ' b mut Option < BasicBlock > ,
1652- fake_borrows : & ' b mut Option < FxIndexSet < Place < ' tcx > > > ,
1647+ fake_borrows : & mut Option < FxIndexSet < Place < ' tcx > > > ,
16531648 ) -> MatchAutomatonStep < ' b , ' c , ' pat , ' tcx > {
16541649 // extract the match-pair from the highest priority candidate
16551650 let match_pair = & candidates. first ( ) . unwrap ( ) . match_pairs [ 0 ] ;
@@ -1720,8 +1715,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
17201715 place : match_place,
17211716 remaining_candidates : candidates,
17221717 target_candidates,
1723- otherwise_block,
1724- fake_borrows,
17251718 }
17261719 }
17271720
0 commit comments