@@ -121,8 +121,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
121
121
match expr. kind {
122
122
ExprKind :: LogicalOp { op : op @ LogicalOp :: And , lhs, rhs } => {
123
123
this. visit_coverage_branch_operation ( op, expr_span) ;
124
- let lhs_then_block = unpack ! ( this. then_else_break_inner( block, lhs, args) ) ;
125
- let rhs_then_block = unpack ! ( this. then_else_break_inner( lhs_then_block, rhs, args) ) ;
124
+ let lhs_then_block =
125
+ this. then_else_break_inner ( block, lhs, args) . unpack_block_and_unit ( ) ;
126
+ let rhs_then_block =
127
+ this. then_else_break_inner ( lhs_then_block, rhs, args) . unpack_block_and_unit ( ) ;
126
128
rhs_then_block. unit ( )
127
129
}
128
130
ExprKind :: LogicalOp { op : op @ LogicalOp :: Or , lhs, rhs } => {
@@ -139,14 +141,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
139
141
} ,
140
142
)
141
143
} ) ;
142
- let rhs_success_block = unpack ! ( this. then_else_break_inner(
143
- failure_block,
144
- rhs,
145
- ThenElseArgs {
146
- declare_let_bindings: DeclareLetBindings :: LetNotPermitted ,
147
- ..args
148
- } ,
149
- ) ) ;
144
+ let rhs_success_block = this
145
+ . then_else_break_inner (
146
+ failure_block,
147
+ rhs,
148
+ ThenElseArgs {
149
+ declare_let_bindings : DeclareLetBindings :: LetNotPermitted ,
150
+ ..args
151
+ } ,
152
+ )
153
+ . unpack_block_and_unit ( ) ;
150
154
151
155
// Make the LHS and RHS success arms converge to a common block.
152
156
// (We can't just make LHS goto RHS, because `rhs_success_block`
@@ -451,7 +455,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
451
455
outer_source_info : SourceInfo ,
452
456
fake_borrow_temps : Vec < ( Place < ' tcx > , Local , FakeBorrowKind ) > ,
453
457
) -> BlockAnd < ( ) > {
454
- let arm_end_blocks: Vec < _ > = arm_candidates
458
+ let arm_end_blocks: Vec < BasicBlock > = arm_candidates
455
459
. into_iter ( )
456
460
. map ( |( arm, candidate) | {
457
461
debug ! ( "lowering arm {:?}\n candidate = {:?}" , arm, candidate) ;
@@ -502,6 +506,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
502
506
503
507
this. expr_into_dest ( destination, arm_block, arm. body )
504
508
} )
509
+ . unpack_block_and_unit ( )
505
510
} )
506
511
. collect ( ) ;
507
512
@@ -512,10 +517,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
512
517
outer_source_info. span . with_lo ( outer_source_info. span . hi ( ) - BytePos :: from_usize ( 1 ) ) ,
513
518
) ;
514
519
for arm_block in arm_end_blocks {
515
- let block = & self . cfg . basic_blocks [ arm_block. 0 ] ;
520
+ let block = & self . cfg . basic_blocks [ arm_block] ;
516
521
let last_location = block. statements . last ( ) . map ( |s| s. source_info ) ;
517
522
518
- self . cfg . goto ( unpack ! ( arm_block) , last_location. unwrap_or ( end_brace) , end_block) ;
523
+ self . cfg . goto ( arm_block, last_location. unwrap_or ( end_brace) , end_block) ;
519
524
}
520
525
521
526
self . source_scope = outer_source_info. scope ;
0 commit comments