@@ -351,9 +351,6 @@ struct Builder<'a, 'tcx> {
351
351
unit_temp : Option < Place < ' tcx > > ,
352
352
353
353
var_debug_info : Vec < VarDebugInfo < ' tcx > > ,
354
-
355
- /// Cached block with the `UNREACHABLE` terminator.
356
- cached_unreachable_block : Option < BasicBlock > ,
357
354
}
358
355
359
356
impl < ' a , ' tcx > Builder < ' a , ' tcx > {
@@ -634,10 +631,6 @@ where
634
631
builder. cfg. terminate( return_block, source_info, TerminatorKind :: Return ) ;
635
632
let should_abort = should_abort_on_panic( tcx, fn_def_id, abi) ;
636
633
builder. build_drop_trees( should_abort) ;
637
- // Attribute any unreachable codepaths to the function's closing brace
638
- if let Some ( unreachable_block) = builder. cached_unreachable_block {
639
- builder. cfg. terminate( unreachable_block, source_info, TerminatorKind :: Unreachable ) ;
640
- }
641
634
return_block. unit( )
642
635
} ) ) ;
643
636
@@ -676,12 +669,6 @@ fn construct_const<'a, 'tcx>(
676
669
677
670
builder. build_drop_trees ( false ) ;
678
671
679
- // Constants may be match expressions in which case an unreachable block may
680
- // be created, so terminate it properly.
681
- if let Some ( unreachable_block) = builder. cached_unreachable_block {
682
- builder. cfg . terminate ( unreachable_block, source_info, TerminatorKind :: Unreachable ) ;
683
- }
684
-
685
672
builder. finish ( )
686
673
}
687
674
@@ -757,7 +744,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
757
744
var_indices : Default :: default ( ) ,
758
745
unit_temp : None ,
759
746
var_debug_info : vec ! [ ] ,
760
- cached_unreachable_block : None ,
761
747
} ;
762
748
763
749
assert_eq ! ( builder. cfg. start_new_block( ) , START_BLOCK ) ;
0 commit comments