@@ -1421,7 +1421,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1421
1421
span : Span ,
1422
1422
scrutinee_span : Span ,
1423
1423
candidates : & mut [ & mut Candidate < ' _ , ' tcx > ] ,
1424
- block : BasicBlock ,
1424
+ start_block : BasicBlock ,
1425
1425
otherwise_block : BasicBlock ,
1426
1426
fake_borrows : & mut Option < FxIndexSet < Place < ' tcx > > > ,
1427
1427
) {
@@ -1431,7 +1431,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1431
1431
span,
1432
1432
scrutinee_span,
1433
1433
candidates,
1434
- block ,
1434
+ start_block ,
1435
1435
otherwise_block,
1436
1436
fake_borrows,
1437
1437
) ;
@@ -1442,12 +1442,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1442
1442
let ( first_match_pair, remaining_match_pairs) = match_pairs. split_first ( ) . unwrap ( ) ;
1443
1443
let PatKind :: Or { ref pats } = & first_match_pair. pattern . kind else { unreachable ! ( ) } ;
1444
1444
1445
- first_candidate. pre_binding_block = Some ( block) ;
1446
1445
let remainder_start = self . cfg . start_new_block ( ) ;
1447
1446
let or_span = first_match_pair. pattern . span ;
1448
1447
// Test the alternatives of this or-pattern.
1449
1448
self . test_or_pattern (
1450
1449
first_candidate,
1450
+ start_block,
1451
1451
remainder_start,
1452
1452
pats,
1453
1453
or_span,
@@ -1493,6 +1493,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1493
1493
fn test_or_pattern < ' pat > (
1494
1494
& mut self ,
1495
1495
candidate : & mut Candidate < ' pat , ' tcx > ,
1496
+ start_block : BasicBlock ,
1496
1497
otherwise : BasicBlock ,
1497
1498
pats : & ' pat [ Box < Pat < ' tcx > > ] ,
1498
1499
or_span : Span ,
@@ -1513,11 +1514,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1513
1514
self . match_candidates (
1514
1515
or_span,
1515
1516
or_span,
1516
- candidate . pre_binding_block . unwrap ( ) ,
1517
+ start_block ,
1517
1518
otherwise,
1518
1519
& mut or_candidate_refs,
1519
1520
fake_borrows,
1520
1521
) ;
1522
+ candidate. pre_binding_block = Some ( start_block) ;
1521
1523
candidate. subcandidates = or_candidates;
1522
1524
self . merge_trivial_subcandidates ( candidate, self . source_info ( or_span) ) ;
1523
1525
}
0 commit comments