@@ -57,8 +57,8 @@ impl<'a> Module<'a> {
5757}
5858
5959/// Maps each module to the corresponding file.
60- pub ( crate ) struct ModResolver < ' ast , ' sess > {
61- parse_sess : & ' sess ParseSess ,
60+ pub ( crate ) struct ModResolver < ' ast , ' psess > {
61+ psess : & ' psess ParseSess ,
6262 directory : Directory ,
6363 file_map : FileModMap < ' ast > ,
6464 recursive : bool ,
@@ -99,10 +99,10 @@ enum SubModKind<'a, 'ast> {
9999 Internal ( & ' a ast:: Item ) ,
100100}
101101
102- impl < ' ast , ' sess , ' c > ModResolver < ' ast , ' sess > {
102+ impl < ' ast , ' psess , ' c > ModResolver < ' ast , ' psess > {
103103 /// Creates a new `ModResolver`.
104104 pub ( crate ) fn new (
105- parse_sess : & ' sess ParseSess ,
105+ psess : & ' psess ParseSess ,
106106 directory_ownership : DirectoryOwnership ,
107107 recursive : bool ,
108108 ) -> Self {
@@ -112,7 +112,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
112112 ownership : directory_ownership,
113113 } ,
114114 file_map : BTreeMap :: new ( ) ,
115- parse_sess ,
115+ psess ,
116116 recursive,
117117 }
118118 }
@@ -122,7 +122,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
122122 mut self ,
123123 krate : & ' ast ast:: Crate ,
124124 ) -> Result < FileModMap < ' ast > , ModuleResolutionError > {
125- let root_filename = self . parse_sess . span_to_filename ( krate. spans . inner_span ) ;
125+ let root_filename = self . psess . span_to_filename ( krate. spans . inner_span ) ;
126126 self . directory . path = match root_filename {
127127 FileName :: Real ( ref p) => p. parent ( ) . unwrap_or ( Path :: new ( "" ) ) . to_path_buf ( ) ,
128128 _ => PathBuf :: new ( ) ,
@@ -133,7 +133,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
133133 self . visit_mod_from_ast ( & krate. items ) ?;
134134 }
135135
136- let snippet_provider = self . parse_sess . snippet_provider ( krate. spans . inner_span ) ;
136+ let snippet_provider = self . psess . snippet_provider ( krate. spans . inner_span ) ;
137137
138138 self . file_map . insert (
139139 root_filename,
@@ -149,7 +149,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
149149
150150 /// Visit `cfg_if` macro and look for module declarations.
151151 fn visit_cfg_if ( & mut self , item : Cow < ' ast , ast:: Item > ) -> Result < ( ) , ModuleResolutionError > {
152- let mut visitor = visitor:: CfgIfVisitor :: new ( self . parse_sess ) ;
152+ let mut visitor = visitor:: CfgIfVisitor :: new ( self . psess ) ;
153153 visitor. visit_item ( & item) ;
154154 for module_item in visitor. mods ( ) {
155155 if let ast:: ItemKind :: Mod ( _, ref sub_mod_kind) = module_item. item . kind {
@@ -338,10 +338,10 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
338338 DirectoryOwnership :: UnownedViaBlock => None ,
339339 } ;
340340 if let Some ( path) = Parser :: submod_path_from_attr ( attrs, & self . directory . path ) {
341- if self . parse_sess . is_file_parsed ( & path) {
341+ if self . psess . is_file_parsed ( & path) {
342342 return Ok ( None ) ;
343343 }
344- return match Parser :: parse_file_as_module ( self . parse_sess , & path, sub_mod. span ) {
344+ return match Parser :: parse_file_as_module ( self . psess , & path, sub_mod. span ) {
345345 Ok ( ( ref attrs, _, _) ) if contains_skip ( attrs) => Ok ( None ) ,
346346 Ok ( ( attrs, items, span) ) => Ok ( Some ( SubModKind :: External (
347347 path,
@@ -368,7 +368,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
368368 let mut mods_outside_ast = self . find_mods_outside_of_ast ( attrs, sub_mod) ;
369369
370370 match self
371- . parse_sess
371+ . psess
372372 . default_submod_path ( mod_name, relative, & self . directory . path )
373373 {
374374 Ok ( ModulePathSuccess {
@@ -380,7 +380,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
380380 let should_insert = !mods_outside_ast
381381 . iter ( )
382382 . any ( |( outside_path, _, _) | outside_path == & file_path) ;
383- if self . parse_sess . is_file_parsed ( & file_path) {
383+ if self . psess . is_file_parsed ( & file_path) {
384384 if outside_mods_empty {
385385 return Ok ( None ) ;
386386 } else {
@@ -390,7 +390,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
390390 return Ok ( Some ( SubModKind :: MultiExternal ( mods_outside_ast) ) ) ;
391391 }
392392 }
393- match Parser :: parse_file_as_module ( self . parse_sess , & file_path, sub_mod. span ) {
393+ match Parser :: parse_file_as_module ( self . psess , & file_path, sub_mod. span ) {
394394 Ok ( ( ref attrs, _, _) ) if contains_skip ( attrs) => Ok ( None ) ,
395395 Ok ( ( attrs, items, span) ) if outside_mods_empty => {
396396 Ok ( Some ( SubModKind :: External (
@@ -517,7 +517,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
517517 if !actual_path. exists ( ) {
518518 continue ;
519519 }
520- if self . parse_sess . is_file_parsed ( & actual_path) {
520+ if self . psess . is_file_parsed ( & actual_path) {
521521 // If the specified file is already parsed, then we just use that.
522522 result. push ( (
523523 actual_path,
@@ -527,7 +527,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
527527 continue ;
528528 }
529529 let ( attrs, items, span) =
530- match Parser :: parse_file_as_module ( self . parse_sess , & actual_path, sub_mod. span ) {
530+ match Parser :: parse_file_as_module ( self . psess , & actual_path, sub_mod. span ) {
531531 Ok ( ( ref attrs, _, _) ) if contains_skip ( attrs) => continue ,
532532 Ok ( m) => m,
533533 Err ( ..) => continue ,
0 commit comments