@@ -31,11 +31,12 @@ mod infer;
31
31
struct NLLVisitor < ' a , ' gcx : ' a + ' tcx , ' tcx : ' a > {
32
32
lookup_map : HashMap < RegionVid , Lookup > ,
33
33
regions : IndexVec < RegionIndex , Region > ,
34
- infcx : InferCtxt < ' a , ' gcx , ' tcx > ,
34
+ #[ allow( dead_code) ]
35
+ infcx : & ' a InferCtxt < ' a , ' gcx , ' tcx > ,
35
36
}
36
37
37
38
impl < ' a , ' gcx , ' tcx > NLLVisitor < ' a , ' gcx , ' tcx > {
38
- pub fn new ( infcx : InferCtxt < ' a , ' gcx , ' tcx > ) -> Self {
39
+ pub fn new ( infcx : & ' a InferCtxt < ' a , ' gcx , ' tcx > ) -> Self {
39
40
NLLVisitor {
40
41
infcx,
41
42
lookup_map : HashMap :: new ( ) ,
@@ -150,7 +151,7 @@ impl MirPass for NLL {
150
151
tcx. infer_ctxt ( ) . enter ( |infcx| {
151
152
// Clone mir so we can mutate it without disturbing the rest of the compiler
152
153
let mut renumbered_mir = mir. clone ( ) ;
153
- let mut visitor = NLLVisitor :: new ( infcx) ;
154
+ let mut visitor = NLLVisitor :: new ( & infcx) ;
154
155
visitor. visit_mir ( & mut renumbered_mir) ;
155
156
mir_util:: dump_mir ( tcx, None , "nll" , & 0 , source, mir, |pass_where, out| {
156
157
if let PassWhere :: BeforeCFG = pass_where {
@@ -162,7 +163,7 @@ impl MirPass for NLL {
162
163
} ) ;
163
164
let ( _lookup_map, regions) = visitor. into_results ( ) ;
164
165
let mut inference_context = InferenceContext :: new ( regions) ;
165
- inference_context. solve ( infcx, & renumbered_mir) ;
166
+ inference_context. solve ( & infcx, & renumbered_mir) ;
166
167
} )
167
168
}
168
169
}
0 commit comments