@@ -72,7 +72,7 @@ impl<'a, 'tcx> MaybeInitializedPlaces<'a, 'tcx> {
72
72
) -> bool {
73
73
if let LookupResult :: Exact ( path) = self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) {
74
74
let mut maybe_live = false ;
75
- on_all_children_bits ( self . tcx , self . body , self . move_data ( ) , path, |child| {
75
+ on_all_children_bits ( self . move_data ( ) , path, |child| {
76
76
maybe_live |= state. contains ( child) ;
77
77
} ) ;
78
78
!maybe_live
@@ -203,14 +203,13 @@ impl<'a, 'tcx> HasMoveData<'tcx> for MaybeUninitializedPlaces<'a, 'tcx> {
203
203
/// this data and `MaybeInitializedPlaces` yields the set of places
204
204
/// that would require a dynamic drop-flag at that statement.
205
205
pub struct DefinitelyInitializedPlaces < ' a , ' tcx > {
206
- tcx : TyCtxt < ' tcx > ,
207
206
body : & ' a Body < ' tcx > ,
208
207
mdpe : & ' a MoveDataParamEnv < ' tcx > ,
209
208
}
210
209
211
210
impl < ' a , ' tcx > DefinitelyInitializedPlaces < ' a , ' tcx > {
212
- pub fn new ( tcx : TyCtxt < ' tcx > , body : & ' a Body < ' tcx > , mdpe : & ' a MoveDataParamEnv < ' tcx > ) -> Self {
213
- DefinitelyInitializedPlaces { tcx , body, mdpe }
211
+ pub fn new ( body : & ' a Body < ' tcx > , mdpe : & ' a MoveDataParamEnv < ' tcx > ) -> Self {
212
+ DefinitelyInitializedPlaces { body, mdpe }
214
213
}
215
214
}
216
215
@@ -317,7 +316,7 @@ impl<'tcx> AnalysisDomain<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
317
316
fn initialize_start_block ( & self , _: & mir:: Body < ' tcx > , state : & mut Self :: Domain ) {
318
317
* state =
319
318
MaybeReachable :: Reachable ( ChunkedBitSet :: new_empty ( self . move_data ( ) . move_paths . len ( ) ) ) ;
320
- drop_flag_effects_for_function_entry ( self . tcx , self . body , self . mdpe , |path, s| {
319
+ drop_flag_effects_for_function_entry ( self . body , self . mdpe , |path, s| {
321
320
assert ! ( s == DropFlagState :: Present ) ;
322
321
state. gen ( path) ;
323
322
} ) ;
@@ -337,7 +336,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
337
336
statement : & mir:: Statement < ' tcx > ,
338
337
location : Location ,
339
338
) {
340
- drop_flag_effects_for_location ( self . tcx , self . body , self . mdpe , location, |path, s| {
339
+ drop_flag_effects_for_location ( self . body , self . mdpe , location, |path, s| {
341
340
Self :: update_bits ( trans, path, s)
342
341
} ) ;
343
342
@@ -349,7 +348,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
349
348
| mir:: Rvalue :: AddressOf ( _, place) = rvalue
350
349
&& let LookupResult :: Exact ( mpi) = self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) )
351
350
{
352
- on_all_children_bits ( self . tcx , self . body , self . move_data ( ) , mpi, |child| {
351
+ on_all_children_bits ( self . move_data ( ) , mpi, |child| {
353
352
trans. gen ( child) ;
354
353
} )
355
354
}
@@ -369,7 +368,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
369
368
{
370
369
edges = TerminatorEdges :: Single ( target) ;
371
370
}
372
- drop_flag_effects_for_location ( self . tcx , self . body , self . mdpe , location, |path, s| {
371
+ drop_flag_effects_for_location ( self . body , self . mdpe , location, |path, s| {
373
372
Self :: update_bits ( state, path, s)
374
373
} ) ;
375
374
edges
@@ -385,8 +384,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
385
384
// when a call returns successfully, that means we need to set
386
385
// the bits for that dest_place to 1 (initialized).
387
386
on_lookup_result_bits (
388
- self . tcx ,
389
- self . body ,
390
387
self . move_data ( ) ,
391
388
self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) ,
392
389
|mpi| {
@@ -430,8 +427,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
430
427
// Kill all move paths that correspond to variants we know to be inactive along this
431
428
// particular outgoing edge of a `SwitchInt`.
432
429
drop_flag_effects:: on_all_inactive_variants (
433
- self . tcx ,
434
- self . body ,
435
430
self . move_data ( ) ,
436
431
enum_place,
437
432
variant,
@@ -456,7 +451,7 @@ impl<'tcx> AnalysisDomain<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
456
451
// set all bits to 1 (uninit) before gathering counter-evidence
457
452
state. insert_all ( ) ;
458
453
459
- drop_flag_effects_for_function_entry ( self . tcx , self . body , self . mdpe , |path, s| {
454
+ drop_flag_effects_for_function_entry ( self . body , self . mdpe , |path, s| {
460
455
assert ! ( s == DropFlagState :: Present ) ;
461
456
state. remove ( path) ;
462
457
} ) ;
@@ -476,7 +471,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
476
471
_statement : & mir:: Statement < ' tcx > ,
477
472
location : Location ,
478
473
) {
479
- drop_flag_effects_for_location ( self . tcx , self . body , self . mdpe , location, |path, s| {
474
+ drop_flag_effects_for_location ( self . body , self . mdpe , location, |path, s| {
480
475
Self :: update_bits ( trans, path, s)
481
476
} ) ;
482
477
@@ -490,7 +485,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
490
485
terminator : & ' mir mir:: Terminator < ' tcx > ,
491
486
location : Location ,
492
487
) -> TerminatorEdges < ' mir , ' tcx > {
493
- drop_flag_effects_for_location ( self . tcx , self . body , self . mdpe , location, |path, s| {
488
+ drop_flag_effects_for_location ( self . body , self . mdpe , location, |path, s| {
494
489
Self :: update_bits ( trans, path, s)
495
490
} ) ;
496
491
if self . skip_unreachable_unwind . contains ( location. block ) {
@@ -512,8 +507,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
512
507
// when a call returns successfully, that means we need to set
513
508
// the bits for that dest_place to 0 (initialized).
514
509
on_lookup_result_bits (
515
- self . tcx ,
516
- self . body ,
517
510
self . move_data ( ) ,
518
511
self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) ,
519
512
|mpi| {
@@ -561,8 +554,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
561
554
// Mark all move paths that correspond to variants other than this one as maybe
562
555
// uninitialized (in reality, they are *definitely* uninitialized).
563
556
drop_flag_effects:: on_all_inactive_variants (
564
- self . tcx ,
565
- self . body ,
566
557
self . move_data ( ) ,
567
558
enum_place,
568
559
variant,
@@ -587,7 +578,7 @@ impl<'a, 'tcx> AnalysisDomain<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> {
587
578
fn initialize_start_block ( & self , _: & mir:: Body < ' tcx > , state : & mut Self :: Domain ) {
588
579
state. 0 . clear ( ) ;
589
580
590
- drop_flag_effects_for_function_entry ( self . tcx , self . body , self . mdpe , |path, s| {
581
+ drop_flag_effects_for_function_entry ( self . body , self . mdpe , |path, s| {
591
582
assert ! ( s == DropFlagState :: Present ) ;
592
583
state. 0 . insert ( path) ;
593
584
} ) ;
@@ -607,7 +598,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for DefinitelyInitializedPlaces<'_, 'tcx> {
607
598
_statement : & mir:: Statement < ' tcx > ,
608
599
location : Location ,
609
600
) {
610
- drop_flag_effects_for_location ( self . tcx , self . body , self . mdpe , location, |path, s| {
601
+ drop_flag_effects_for_location ( self . body , self . mdpe , location, |path, s| {
611
602
Self :: update_bits ( trans, path, s)
612
603
} )
613
604
}
@@ -618,7 +609,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for DefinitelyInitializedPlaces<'_, 'tcx> {
618
609
terminator : & ' mir mir:: Terminator < ' tcx > ,
619
610
location : Location ,
620
611
) -> TerminatorEdges < ' mir , ' tcx > {
621
- drop_flag_effects_for_location ( self . tcx , self . body , self . mdpe , location, |path, s| {
612
+ drop_flag_effects_for_location ( self . body , self . mdpe , location, |path, s| {
622
613
Self :: update_bits ( trans, path, s)
623
614
} ) ;
624
615
terminator. edges ( )
@@ -634,8 +625,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for DefinitelyInitializedPlaces<'_, 'tcx> {
634
625
// when a call returns successfully, that means we need to set
635
626
// the bits for that dest_place to 1 (initialized).
636
627
on_lookup_result_bits (
637
- self . tcx ,
638
- self . body ,
639
628
self . move_data ( ) ,
640
629
self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) ,
641
630
|mpi| {
0 commit comments