@@ -6,7 +6,6 @@ use rustc_data_structures::fx::FxHashSet;
66use rustc_data_structures:: sync:: Lrc ;
77use rustc_hir:: def_id:: { LocalDefId , CRATE_DEF_ID } ;
88use rustc_hir:: { self as hir, intravisit, CRATE_HIR_ID } ;
9- use rustc_middle:: hir:: map:: Map ;
109use rustc_middle:: hir:: nested_filter;
1110use rustc_middle:: ty:: TyCtxt ;
1211use rustc_resolve:: rustdoc:: span_of_fragments;
@@ -63,27 +62,21 @@ impl DocTestVisitor for RustCollector {
6362}
6463
6564pub ( super ) struct HirCollector < ' tcx > {
66- map : Map < ' tcx > ,
6765 codes : ErrorCodes ,
6866 tcx : TyCtxt < ' tcx > ,
6967 enable_per_target_ignores : bool ,
7068 collector : RustCollector ,
7169}
7270
7371impl < ' tcx > HirCollector < ' tcx > {
74- pub fn new (
75- map : Map < ' tcx > ,
76- codes : ErrorCodes ,
77- enable_per_target_ignores : bool ,
78- tcx : TyCtxt < ' tcx > ,
79- ) -> Self {
72+ pub fn new ( codes : ErrorCodes , enable_per_target_ignores : bool , tcx : TyCtxt < ' tcx > ) -> Self {
8073 let collector = RustCollector {
8174 source_map : tcx. sess . psess . clone_source_map ( ) ,
8275 cur_path : vec ! [ ] ,
8376 position : DUMMY_SP ,
8477 tests : vec ! [ ] ,
8578 } ;
86- Self { map , codes, enable_per_target_ignores, tcx, collector }
79+ Self { codes, enable_per_target_ignores, tcx, collector }
8780 }
8881
8982 pub fn collect_crate ( mut self ) -> Vec < ScrapedDocTest > {
@@ -151,13 +144,13 @@ impl<'tcx> intravisit::Visitor<'tcx> for HirCollector<'tcx> {
151144 type NestedFilter = nested_filter:: All ;
152145
153146 fn nested_visit_map ( & mut self ) -> Self :: Map {
154- self . map
147+ self . tcx . hir ( )
155148 }
156149
157150 fn visit_item ( & mut self , item : & ' tcx hir:: Item < ' _ > ) {
158151 let name = match & item. kind {
159152 hir:: ItemKind :: Impl ( impl_) => {
160- rustc_hir_pretty:: id_to_string ( & self . map , impl_. self_ty . hir_id )
153+ rustc_hir_pretty:: id_to_string ( & self . tcx . hir ( ) , impl_. self_ty . hir_id )
161154 }
162155 _ => item. ident . to_string ( ) ,
163156 } ;
0 commit comments