@@ -9,7 +9,6 @@ use rustc_hir::intravisit::{self, Visitor};
99use rustc_hir:: { self as hir} ;
1010use rustc_interface:: interface;
1111use rustc_macros:: { Decodable , Encodable } ;
12- use rustc_middle:: hir:: map:: Map ;
1312use rustc_middle:: hir:: nested_filter;
1413use rustc_middle:: ty:: { self , TyCtxt } ;
1514use rustc_serialize:: opaque:: { FileEncoder , MemDecoder } ;
@@ -107,8 +106,6 @@ pub(crate) type AllCallLocations = FxIndexMap<DefPathHash, FnCallLocations>;
107106
108107/// Visitor for traversing a crate and finding instances of function calls.
109108struct FindCalls < ' a , ' tcx > {
110- tcx : TyCtxt < ' tcx > ,
111- map : Map < ' tcx > ,
112109 cx : Context < ' tcx > ,
113110 target_crates : Vec < CrateNum > ,
114111 calls : & ' a mut AllCallLocations ,
@@ -122,13 +119,13 @@ where
122119 type NestedFilter = nested_filter:: OnlyBodies ;
123120
124121 fn nested_visit_map ( & mut self ) -> Self :: Map {
125- self . map
122+ self . cx . tcx ( ) . hir ( )
126123 }
127124
128125 fn visit_expr ( & mut self , ex : & ' tcx hir:: Expr < ' tcx > ) {
129126 intravisit:: walk_expr ( self , ex) ;
130127
131- let tcx = self . tcx ;
128+ let tcx = self . cx . tcx ( ) ;
132129
133130 // If we visit an item that contains an expression outside a function body,
134131 // then we need to exit before calling typeck (which will panic). See
@@ -294,8 +291,7 @@ pub(crate) fn run(
294291
295292 // Run call-finder on all items
296293 let mut calls = FxIndexMap :: default ( ) ;
297- let mut finder =
298- FindCalls { calls : & mut calls, tcx, map : tcx. hir ( ) , cx, target_crates, bin_crate } ;
294+ let mut finder = FindCalls { calls : & mut calls, cx, target_crates, bin_crate } ;
299295 tcx. hir ( ) . visit_all_item_likes_in_crate ( & mut finder) ;
300296
301297 // The visitor might have found a type error, which we need to
0 commit comments