@@ -13,15 +13,15 @@ use dataflow::move_paths::{HasMoveData, MoveData};
13
13
use dataflow:: MaybeInitializedPlaces ;
14
14
use dataflow:: { FlowAtLocation , FlowsAtLocation } ;
15
15
use rustc:: infer:: canonical:: QueryRegionConstraint ;
16
- use rustc:: mir:: { Local , LocalWithRegion } ;
16
+ use rustc:: mir:: LocalWithRegion ;
17
17
use rustc:: mir:: { BasicBlock , Location , Mir } ;
18
18
use rustc:: traits:: query:: dropck_outlives:: DropckOutlivesResult ;
19
19
use rustc:: traits:: query:: type_op:: outlives:: DropckOutlives ;
20
20
use rustc:: traits:: query:: type_op:: TypeOp ;
21
21
use rustc:: ty:: { Ty , TypeFoldable } ;
22
22
use rustc_data_structures:: fx:: FxHashMap ;
23
23
use std:: rc:: Rc ;
24
- use util:: liveness:: { IdentityMap , LivenessResults } ;
24
+ use util:: liveness:: { NllLivenessMap , LivenessResults , LiveVariableMap } ;
25
25
26
26
use super :: TypeChecker ;
27
27
@@ -47,7 +47,7 @@ pub(super) fn generate<'gcx, 'tcx>(
47
47
flow_inits,
48
48
move_data,
49
49
drop_data : FxHashMap ( ) ,
50
- map : & IdentityMap :: new ( mir) ,
50
+ map : & NllLivenessMap :: compute ( mir) ,
51
51
} ;
52
52
53
53
for bb in mir. basic_blocks ( ) . indices ( ) {
68
68
flow_inits : & ' gen mut FlowAtLocation < MaybeInitializedPlaces < ' flow , ' gcx , ' tcx > > ,
69
69
move_data : & ' gen MoveData < ' tcx > ,
70
70
drop_data : FxHashMap < Ty < ' tcx > , DropData < ' tcx > > ,
71
- map : & ' gen IdentityMap < ' gen , ' tcx > ,
71
+ map : & ' gen NllLivenessMap ,
72
72
}
73
73
74
74
struct DropData < ' tcx > {
@@ -88,7 +88,8 @@ impl<'gen, 'typeck, 'flow, 'gcx, 'tcx> TypeLivenessGenerator<'gen, 'typeck, 'flo
88
88
. regular
89
89
. simulate_block ( self . mir , bb, self . map , |location, live_locals| {
90
90
for live_local in live_locals. iter ( ) {
91
- let live_local_ty = self . mir . local_decls [ live_local] . ty ;
91
+ let local = self . map . from_live_var ( live_local) ;
92
+ let live_local_ty = self . mir . local_decls [ local] . ty ;
92
93
Self :: push_type_live_constraint ( & mut self . cx , live_local_ty, location) ;
93
94
}
94
95
} ) ;
@@ -123,15 +124,17 @@ impl<'gen, 'typeck, 'flow, 'gcx, 'tcx> TypeLivenessGenerator<'gen, 'typeck, 'flo
123
124
} ) ;
124
125
}
125
126
126
- let mpi = self . move_data . rev_lookup . find_local ( live_local) ;
127
+ let local = self . map . from_live_var ( live_local) ;
128
+ let mpi = self . move_data . rev_lookup . find_local ( local) ;
127
129
if let Some ( initialized_child) = self . flow_inits . has_any_child_of ( mpi) {
128
130
debug ! (
129
131
"add_liveness_constraints: mpi={:?} has initialized child {:?}" ,
130
132
self . move_data. move_paths[ mpi] ,
131
133
self . move_data. move_paths[ initialized_child]
132
134
) ;
133
135
134
- let live_local_ty = self . mir . local_decls [ live_local] . ty ;
136
+ let local = self . map . from_live_var ( live_local) ;
137
+ let live_local_ty = self . mir . local_decls [ local] . ty ;
135
138
self . add_drop_live_constraint ( live_local, live_local_ty, location) ;
136
139
}
137
140
}
0 commit comments