@@ -10,7 +10,6 @@ use rustc_middle::hir::map::Map;
1010use rustc_middle:: hir:: nested_filter;
1111use rustc_middle:: ty:: TyCtxt ;
1212use rustc_resolve:: rustdoc:: span_of_fragments;
13- use rustc_session:: Session ;
1413use rustc_span:: source_map:: SourceMap ;
1514use rustc_span:: { BytePos , FileName , Pos , Span , DUMMY_SP } ;
1615
@@ -63,30 +62,28 @@ impl DocTestVisitor for RustCollector {
6362 fn visit_header ( & mut self , _name : & str , _level : u32 ) { }
6463}
6564
66- pub ( super ) struct HirCollector < ' a , ' tcx > {
67- sess : & ' a Session ,
65+ pub ( super ) struct HirCollector < ' tcx > {
6866 map : Map < ' tcx > ,
6967 codes : ErrorCodes ,
7068 tcx : TyCtxt < ' tcx > ,
7169 enable_per_target_ignores : bool ,
7270 collector : RustCollector ,
7371}
7472
75- impl < ' a , ' tcx > HirCollector < ' a , ' tcx > {
73+ impl < ' tcx > HirCollector < ' tcx > {
7674 pub fn new (
77- sess : & ' a Session ,
7875 map : Map < ' tcx > ,
7976 codes : ErrorCodes ,
8077 enable_per_target_ignores : bool ,
8178 tcx : TyCtxt < ' tcx > ,
8279 ) -> Self {
8380 let collector = RustCollector {
84- source_map : sess. psess . clone_source_map ( ) ,
81+ source_map : tcx . sess . psess . clone_source_map ( ) ,
8582 cur_path : vec ! [ ] ,
8683 position : DUMMY_SP ,
8784 tests : vec ! [ ] ,
8885 } ;
89- Self { sess , map, codes, enable_per_target_ignores, tcx, collector }
86+ Self { map, codes, enable_per_target_ignores, tcx, collector }
9087 }
9188
9289 pub fn collect_crate ( mut self ) -> Vec < ScrapedDocTest > {
@@ -98,7 +95,7 @@ impl<'a, 'tcx> HirCollector<'a, 'tcx> {
9895 }
9996}
10097
101- impl < ' a , ' tcx > HirCollector < ' a , ' tcx > {
98+ impl < ' tcx > HirCollector < ' tcx > {
10299 fn visit_testable < F : FnOnce ( & mut Self ) > (
103100 & mut self ,
104101 name : String ,
@@ -108,7 +105,7 @@ impl<'a, 'tcx> HirCollector<'a, 'tcx> {
108105 ) {
109106 let ast_attrs = self . tcx . hir ( ) . attrs ( self . tcx . local_def_id_to_hir_id ( def_id) ) ;
110107 if let Some ( ref cfg) = ast_attrs. cfg ( self . tcx , & FxHashSet :: default ( ) ) {
111- if !cfg. matches ( & self . sess . psess , Some ( self . tcx . features ( ) ) ) {
108+ if !cfg. matches ( & self . tcx . sess . psess , Some ( self . tcx . features ( ) ) ) {
112109 return ;
113110 }
114111 }
@@ -150,7 +147,7 @@ impl<'a, 'tcx> HirCollector<'a, 'tcx> {
150147 }
151148}
152149
153- impl < ' a , ' tcx > intravisit:: Visitor < ' tcx > for HirCollector < ' a , ' tcx > {
150+ impl < ' tcx > intravisit:: Visitor < ' tcx > for HirCollector < ' tcx > {
154151 type NestedFilter = nested_filter:: All ;
155152
156153 fn nested_visit_map ( & mut self ) -> Self :: Map {
0 commit comments