@@ -72,7 +72,7 @@ impl<'a, 'tcx> MaybeInitializedPlaces<'a, 'tcx> {
7272 ) -> bool {
7373 if let LookupResult :: Exact ( path) = self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) {
7474 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| {
7676 maybe_live |= state. contains ( child) ;
7777 } ) ;
7878 !maybe_live
@@ -203,14 +203,13 @@ impl<'a, 'tcx> HasMoveData<'tcx> for MaybeUninitializedPlaces<'a, 'tcx> {
203203/// this data and `MaybeInitializedPlaces` yields the set of places
204204/// that would require a dynamic drop-flag at that statement.
205205pub struct DefinitelyInitializedPlaces < ' a , ' tcx > {
206- tcx : TyCtxt < ' tcx > ,
207206 body : & ' a Body < ' tcx > ,
208207 mdpe : & ' a MoveDataParamEnv < ' tcx > ,
209208}
210209
211210impl < ' 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 }
214213 }
215214}
216215
@@ -317,7 +316,7 @@ impl<'tcx> AnalysisDomain<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
317316 fn initialize_start_block ( & self , _: & mir:: Body < ' tcx > , state : & mut Self :: Domain ) {
318317 * state =
319318 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| {
321320 assert ! ( s == DropFlagState :: Present ) ;
322321 state. gen ( path) ;
323322 } ) ;
@@ -337,7 +336,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
337336 statement : & mir:: Statement < ' tcx > ,
338337 location : Location ,
339338 ) {
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| {
341340 Self :: update_bits ( trans, path, s)
342341 } ) ;
343342
@@ -349,7 +348,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
349348 | mir:: Rvalue :: AddressOf ( _, place) = rvalue
350349 && let LookupResult :: Exact ( mpi) = self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) )
351350 {
352- on_all_children_bits ( self . tcx , self . body , self . move_data ( ) , mpi, |child| {
351+ on_all_children_bits ( self . move_data ( ) , mpi, |child| {
353352 trans. gen ( child) ;
354353 } )
355354 }
@@ -369,7 +368,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
369368 {
370369 edges = TerminatorEdges :: Single ( target) ;
371370 }
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| {
373372 Self :: update_bits ( state, path, s)
374373 } ) ;
375374 edges
@@ -385,8 +384,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
385384 // when a call returns successfully, that means we need to set
386385 // the bits for that dest_place to 1 (initialized).
387386 on_lookup_result_bits (
388- self . tcx ,
389- self . body ,
390387 self . move_data ( ) ,
391388 self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) ,
392389 |mpi| {
@@ -430,8 +427,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
430427 // Kill all move paths that correspond to variants we know to be inactive along this
431428 // particular outgoing edge of a `SwitchInt`.
432429 drop_flag_effects:: on_all_inactive_variants (
433- self . tcx ,
434- self . body ,
435430 self . move_data ( ) ,
436431 enum_place,
437432 variant,
@@ -456,7 +451,7 @@ impl<'tcx> AnalysisDomain<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
456451 // set all bits to 1 (uninit) before gathering counter-evidence
457452 state. insert_all ( ) ;
458453
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| {
460455 assert ! ( s == DropFlagState :: Present ) ;
461456 state. remove ( path) ;
462457 } ) ;
@@ -476,7 +471,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
476471 _statement : & mir:: Statement < ' tcx > ,
477472 location : Location ,
478473 ) {
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| {
480475 Self :: update_bits ( trans, path, s)
481476 } ) ;
482477
@@ -490,7 +485,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
490485 terminator : & ' mir mir:: Terminator < ' tcx > ,
491486 location : Location ,
492487 ) -> 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| {
494489 Self :: update_bits ( trans, path, s)
495490 } ) ;
496491 if self . skip_unreachable_unwind . contains ( location. block ) {
@@ -512,8 +507,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
512507 // when a call returns successfully, that means we need to set
513508 // the bits for that dest_place to 0 (initialized).
514509 on_lookup_result_bits (
515- self . tcx ,
516- self . body ,
517510 self . move_data ( ) ,
518511 self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) ,
519512 |mpi| {
@@ -561,8 +554,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
561554 // Mark all move paths that correspond to variants other than this one as maybe
562555 // uninitialized (in reality, they are *definitely* uninitialized).
563556 drop_flag_effects:: on_all_inactive_variants (
564- self . tcx ,
565- self . body ,
566557 self . move_data ( ) ,
567558 enum_place,
568559 variant,
@@ -587,7 +578,7 @@ impl<'a, 'tcx> AnalysisDomain<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> {
587578 fn initialize_start_block ( & self , _: & mir:: Body < ' tcx > , state : & mut Self :: Domain ) {
588579 state. 0 . clear ( ) ;
589580
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| {
591582 assert ! ( s == DropFlagState :: Present ) ;
592583 state. 0 . insert ( path) ;
593584 } ) ;
@@ -607,7 +598,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for DefinitelyInitializedPlaces<'_, 'tcx> {
607598 _statement : & mir:: Statement < ' tcx > ,
608599 location : Location ,
609600 ) {
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| {
611602 Self :: update_bits ( trans, path, s)
612603 } )
613604 }
@@ -618,7 +609,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for DefinitelyInitializedPlaces<'_, 'tcx> {
618609 terminator : & ' mir mir:: Terminator < ' tcx > ,
619610 location : Location ,
620611 ) -> 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| {
622613 Self :: update_bits ( trans, path, s)
623614 } ) ;
624615 terminator. edges ( )
@@ -634,8 +625,6 @@ impl<'tcx> GenKillAnalysis<'tcx> for DefinitelyInitializedPlaces<'_, 'tcx> {
634625 // when a call returns successfully, that means we need to set
635626 // the bits for that dest_place to 1 (initialized).
636627 on_lookup_result_bits (
637- self . tcx ,
638- self . body ,
639628 self . move_data ( ) ,
640629 self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) ,
641630 |mpi| {
0 commit comments