@@ -74,12 +74,6 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops {
74
74
. iterate_to_fixpoint ( )
75
75
. into_results_cursor ( body) ;
76
76
let dead_unwinds = compute_dead_unwinds ( & body, & mut inits) ;
77
- let mut reachable = BitSet :: new_empty ( body. basic_blocks . len ( ) ) ;
78
- for bb in body. basic_blocks . indices ( ) {
79
- if inits. results ( ) . entry_set_for_block ( bb) . is_reachable ( ) {
80
- reachable. insert ( bb) ;
81
- }
82
- }
83
77
84
78
let uninits = MaybeUninitializedPlaces :: new ( tcx, body, & env)
85
79
. mark_inactive_variants_as_uninit ( )
@@ -97,7 +91,6 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops {
97
91
init_data : InitializationData { inits, uninits } ,
98
92
drop_flags,
99
93
patch : MirPatch :: new ( body) ,
100
- reachable,
101
94
}
102
95
. elaborate ( )
103
96
} ;
@@ -262,7 +255,6 @@ struct ElaborateDropsCtxt<'a, 'tcx> {
262
255
init_data : InitializationData < ' a , ' tcx > ,
263
256
drop_flags : IndexVec < MovePathIndex , Option < Local > > ,
264
257
patch : MirPatch < ' tcx > ,
265
- reachable : BitSet < BasicBlock > ,
266
258
}
267
259
268
260
impl < ' b , ' tcx > ElaborateDropsCtxt < ' b , ' tcx > {
@@ -302,9 +294,6 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
302
294
303
295
fn collect_drop_flags ( & mut self ) {
304
296
for ( bb, data) in self . body . basic_blocks . iter_enumerated ( ) {
305
- if !self . reachable . contains ( bb) {
306
- continue ;
307
- }
308
297
let terminator = data. terminator ( ) ;
309
298
let place = match terminator. kind {
310
299
TerminatorKind :: Drop { ref place, .. } => place,
@@ -356,9 +345,6 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
356
345
357
346
fn elaborate_drops ( & mut self ) {
358
347
for ( bb, data) in self . body . basic_blocks . iter_enumerated ( ) {
359
- if !self . reachable . contains ( bb) {
360
- continue ;
361
- }
362
348
let loc = Location { block : bb, statement_index : data. statements . len ( ) } ;
363
349
let terminator = data. terminator ( ) ;
364
350
@@ -437,9 +423,6 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
437
423
438
424
fn drop_flags_for_fn_rets ( & mut self ) {
439
425
for ( bb, data) in self . body . basic_blocks . iter_enumerated ( ) {
440
- if !self . reachable . contains ( bb) {
441
- continue ;
442
- }
443
426
if let TerminatorKind :: Call {
444
427
destination,
445
428
target : Some ( tgt) ,
@@ -478,9 +461,6 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
478
461
// clobbered before they are read.
479
462
480
463
for ( bb, data) in self . body . basic_blocks . iter_enumerated ( ) {
481
- if !self . reachable . contains ( bb) {
482
- continue ;
483
- }
484
464
debug ! ( "drop_flags_for_locs({:?})" , data) ;
485
465
for i in 0 ..( data. statements . len ( ) + 1 ) {
486
466
debug ! ( "drop_flag_for_locs: stmt {}" , i) ;
0 commit comments