@@ -57,7 +57,7 @@ impl ImportDirectiveSubclass {
5757
5858/// One import directive.
5959#[ derive( Debug , Clone ) ]
60- pub struct ImportDirective {
60+ pub struct ImportDirective < ' a > {
6161 module_path : Vec < Name > ,
6262 subclass : ImportDirectiveSubclass ,
6363 span : Span ,
@@ -66,14 +66,14 @@ pub struct ImportDirective {
6666 is_prelude : bool ,
6767}
6868
69- impl ImportDirective {
69+ impl < ' a > ImportDirective < ' a > {
7070 pub fn new ( module_path : Vec < Name > ,
7171 subclass : ImportDirectiveSubclass ,
7272 span : Span ,
7373 id : NodeId ,
7474 is_public : bool ,
7575 is_prelude : bool )
76- -> ImportDirective {
76+ -> Self {
7777 ImportDirective {
7878 module_path : module_path,
7979 subclass : subclass,
@@ -86,9 +86,8 @@ impl ImportDirective {
8686
8787 // Given the binding to which this directive resolves in a particular namespace,
8888 // this returns the binding for the name this directive defines in that namespace.
89- fn import < ' a > ( & self ,
90- binding : & ' a NameBinding < ' a > ,
91- privacy_error : Option < Box < PrivacyError < ' a > > > ) -> NameBinding < ' a > {
89+ fn import ( & self , binding : & ' a NameBinding < ' a > , privacy_error : Option < Box < PrivacyError < ' a > > > )
90+ -> NameBinding < ' a > {
9291 let mut modifiers = match self . is_public {
9392 true => DefModifiers :: PUBLIC | DefModifiers :: IMPORTABLE ,
9493 false => DefModifiers :: empty ( ) ,
@@ -292,7 +291,7 @@ impl<'a> ::ModuleS<'a> {
292291struct ImportResolvingError < ' a > {
293292 /// Module where the error happened
294293 source_module : Module < ' a > ,
295- import_directive : & ' a ImportDirective ,
294+ import_directive : & ' a ImportDirective < ' a > ,
296295 span : Span ,
297296 help : String ,
298297}
@@ -424,7 +423,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
424423 /// don't know whether the name exists at the moment due to other
425424 /// currently-unresolved imports, or success if we know the name exists.
426425 /// If successful, the resolved bindings are written into the module.
427- fn resolve_import ( & mut self , directive : & ' b ImportDirective ) -> ResolveResult < ( ) > {
426+ fn resolve_import ( & mut self , directive : & ' b ImportDirective < ' b > ) -> ResolveResult < ( ) > {
428427 debug ! ( "(resolving import for module) resolving import `{}::...` in `{}`" ,
429428 names_to_string( & directive. module_path) ,
430429 module_to_string( self . resolver. current_module) ) ;
@@ -579,7 +578,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
579578 // succeeds or bails out (as importing * from an empty module or a module
580579 // that exports nothing is valid). target_module is the module we are
581580 // actually importing, i.e., `foo` in `use foo::*`.
582- fn resolve_glob_import ( & mut self , target_module : Module < ' b > , directive : & ' b ImportDirective )
581+ fn resolve_glob_import ( & mut self , target_module : Module < ' b > , directive : & ' b ImportDirective < ' b > )
583582 -> ResolveResult < ( ) > {
584583 if let Some ( Def :: Trait ( _) ) = target_module. def {
585584 self . resolver . session . span_err ( directive. span , "items in traits are not importable." ) ;
0 commit comments