@@ -62,6 +62,7 @@ use rustc_data_structures::indexed_vec::{Idx, IndexVec};
6262use rustc_data_structures:: bit_set:: { BitSet , BitMatrix } ;
6363use std:: borrow:: Cow ;
6464use std:: iter;
65+ use std:: marker:: PhantomData ;
6566use std:: mem;
6667use crate :: transform:: { MirPass , MirSource } ;
6768use crate :: transform:: simplify;
@@ -539,8 +540,8 @@ fn locals_live_across_suspend_points(
539540 body,
540541 & live_locals,
541542 & ignored,
542- storage_live ,
543- storage_live_analysis ) ;
543+ requires_storage ,
544+ requires_storage_analysis ) ;
544545
545546 LivenessInfo {
546547 live_locals,
@@ -577,8 +578,8 @@ fn compute_storage_conflicts(
577578 body : & ' mir Body < ' tcx > ,
578579 stored_locals : & liveness:: LiveVarSet ,
579580 ignored : & StorageIgnored ,
580- storage_live : DataflowResults < ' tcx , MaybeStorageLive < ' mir , ' tcx > > ,
581- _storage_live_analysis : MaybeStorageLive < ' mir , ' tcx > ,
581+ requires_storage : DataflowResults < ' tcx , RequiresStorage < ' mir , ' tcx , ' _ > > ,
582+ _requires_storage_analysis : RequiresStorage < ' mir , ' tcx , ' _ > ,
582583) -> BitMatrix < GeneratorSavedLocal , GeneratorSavedLocal > {
583584 assert_eq ! ( body. local_decls. len( ) , ignored. 0 . domain_size( ) ) ;
584585 assert_eq ! ( body. local_decls. len( ) , stored_locals. domain_size( ) ) ;
@@ -594,9 +595,10 @@ fn compute_storage_conflicts(
594595 let mut visitor = StorageConflictVisitor {
595596 body,
596597 stored_locals : & stored_locals,
597- local_conflicts : BitMatrix :: from_row_n ( & ineligible_locals, body. local_decls . len ( ) )
598+ local_conflicts : BitMatrix :: from_row_n ( & ineligible_locals, body. local_decls . len ( ) ) ,
599+ _phantom : PhantomData :: default ( ) ,
598600 } ;
599- let mut state = FlowAtLocation :: new ( storage_live ) ;
601+ let mut state = FlowAtLocation :: new ( requires_storage ) ;
600602 visitor. analyze_results ( & mut state) ;
601603 let local_conflicts = visitor. local_conflicts ;
602604
@@ -626,18 +628,19 @@ fn compute_storage_conflicts(
626628 storage_conflicts
627629}
628630
629- struct StorageConflictVisitor < ' body , ' tcx , ' s > {
631+ struct StorageConflictVisitor < ' body : ' b , ' tcx , ' s , ' b > {
630632 body : & ' body Body < ' tcx > ,
631633 stored_locals : & ' s liveness:: LiveVarSet ,
632634 // FIXME(tmandry): Consider using sparse bitsets here once we have good
633635 // benchmarks for generators.
634636 local_conflicts : BitMatrix < Local , Local > ,
637+ _phantom : PhantomData < & ' b ( ) > ,
635638}
636639
637- impl < ' body , ' tcx , ' s > DataflowResultsConsumer < ' body , ' tcx >
638- for StorageConflictVisitor < ' body , ' tcx , ' s >
640+ impl < ' body , ' tcx , ' s , ' b > DataflowResultsConsumer < ' body , ' tcx >
641+ for StorageConflictVisitor < ' body , ' tcx , ' s , ' b >
639642{
640- type FlowState = FlowAtLocation < ' tcx , MaybeStorageLive < ' body , ' tcx > > ;
643+ type FlowState = FlowAtLocation < ' tcx , RequiresStorage < ' body , ' tcx , ' b > > ;
641644
642645 fn body ( & self ) -> & ' body Body < ' tcx > {
643646 self . body
@@ -665,9 +668,9 @@ impl<'body, 'tcx, 's> DataflowResultsConsumer<'body, 'tcx>
665668 }
666669}
667670
668- impl < ' body , ' tcx , ' s > StorageConflictVisitor < ' body , ' tcx , ' s > {
671+ impl < ' body , ' tcx , ' s , ' b > StorageConflictVisitor < ' body , ' tcx , ' s , ' b > {
669672 fn apply_state ( & mut self ,
670- flow_state : & FlowAtLocation < ' tcx , MaybeStorageLive < ' body , ' tcx > > ,
673+ flow_state : & FlowAtLocation < ' tcx , RequiresStorage < ' body , ' tcx , ' b > > ,
671674 loc : Location ) {
672675 // Ignore unreachable blocks.
673676 match self . body . basic_blocks ( ) [ loc. block ] . terminator ( ) . kind {
0 commit comments