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