@@ -62,6 +62,7 @@ use rustc_data_structures::indexed_vec::{Idx, IndexVec};
62
62
use rustc_data_structures:: bit_set:: { BitSet , BitMatrix } ;
63
63
use std:: borrow:: Cow ;
64
64
use std:: iter;
65
+ use std:: marker:: PhantomData ;
65
66
use std:: mem;
66
67
use crate :: transform:: { MirPass , MirSource } ;
67
68
use crate :: transform:: simplify;
@@ -539,8 +540,8 @@ fn locals_live_across_suspend_points(
539
540
body,
540
541
& live_locals,
541
542
& ignored,
542
- storage_live ,
543
- storage_live_analysis ) ;
543
+ requires_storage ,
544
+ requires_storage_analysis ) ;
544
545
545
546
LivenessInfo {
546
547
live_locals,
@@ -577,8 +578,8 @@ fn compute_storage_conflicts(
577
578
body : & ' mir Body < ' tcx > ,
578
579
stored_locals : & liveness:: LiveVarSet ,
579
580
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 , ' _ > ,
582
583
) -> BitMatrix < GeneratorSavedLocal , GeneratorSavedLocal > {
583
584
assert_eq ! ( body. local_decls. len( ) , ignored. 0 . domain_size( ) ) ;
584
585
assert_eq ! ( body. local_decls. len( ) , stored_locals. domain_size( ) ) ;
@@ -594,9 +595,10 @@ fn compute_storage_conflicts(
594
595
let mut visitor = StorageConflictVisitor {
595
596
body,
596
597
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 ( ) ,
598
600
} ;
599
- let mut state = FlowAtLocation :: new ( storage_live ) ;
601
+ let mut state = FlowAtLocation :: new ( requires_storage ) ;
600
602
visitor. analyze_results ( & mut state) ;
601
603
let local_conflicts = visitor. local_conflicts ;
602
604
@@ -626,18 +628,19 @@ fn compute_storage_conflicts(
626
628
storage_conflicts
627
629
}
628
630
629
- struct StorageConflictVisitor < ' body , ' tcx , ' s > {
631
+ struct StorageConflictVisitor < ' body : ' b , ' tcx , ' s , ' b > {
630
632
body : & ' body Body < ' tcx > ,
631
633
stored_locals : & ' s liveness:: LiveVarSet ,
632
634
// FIXME(tmandry): Consider using sparse bitsets here once we have good
633
635
// benchmarks for generators.
634
636
local_conflicts : BitMatrix < Local , Local > ,
637
+ _phantom : PhantomData < & ' b ( ) > ,
635
638
}
636
639
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 >
639
642
{
640
- type FlowState = FlowAtLocation < ' tcx , MaybeStorageLive < ' body , ' tcx > > ;
643
+ type FlowState = FlowAtLocation < ' tcx , RequiresStorage < ' body , ' tcx , ' b > > ;
641
644
642
645
fn body ( & self ) -> & ' body Body < ' tcx > {
643
646
self . body
@@ -665,9 +668,9 @@ impl<'body, 'tcx, 's> DataflowResultsConsumer<'body, 'tcx>
665
668
}
666
669
}
667
670
668
- impl < ' body , ' tcx , ' s > StorageConflictVisitor < ' body , ' tcx , ' s > {
671
+ impl < ' body , ' tcx , ' s , ' b > StorageConflictVisitor < ' body , ' tcx , ' s , ' b > {
669
672
fn apply_state ( & mut self ,
670
- flow_state : & FlowAtLocation < ' tcx , MaybeStorageLive < ' body , ' tcx > > ,
673
+ flow_state : & FlowAtLocation < ' tcx , RequiresStorage < ' body , ' tcx , ' b > > ,
671
674
loc : Location ) {
672
675
// Ignore unreachable blocks.
673
676
match self . body . basic_blocks ( ) [ loc. block ] . terminator ( ) . kind {
0 commit comments