@@ -57,7 +57,7 @@ impl ImportDirectiveSubclass {
57
57
58
58
/// One import directive.
59
59
#[ derive( Debug , Clone ) ]
60
- pub struct ImportDirective {
60
+ pub struct ImportDirective < ' a > {
61
61
module_path : Vec < Name > ,
62
62
subclass : ImportDirectiveSubclass ,
63
63
span : Span ,
@@ -66,14 +66,14 @@ pub struct ImportDirective {
66
66
is_prelude : bool ,
67
67
}
68
68
69
- impl ImportDirective {
69
+ impl < ' a > ImportDirective < ' a > {
70
70
pub fn new ( module_path : Vec < Name > ,
71
71
subclass : ImportDirectiveSubclass ,
72
72
span : Span ,
73
73
id : NodeId ,
74
74
is_public : bool ,
75
75
is_prelude : bool )
76
- -> ImportDirective {
76
+ -> Self {
77
77
ImportDirective {
78
78
module_path : module_path,
79
79
subclass : subclass,
@@ -86,9 +86,8 @@ impl ImportDirective {
86
86
87
87
// Given the binding to which this directive resolves in a particular namespace,
88
88
// 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 > {
92
91
let mut modifiers = match self . is_public {
93
92
true => DefModifiers :: PUBLIC | DefModifiers :: IMPORTABLE ,
94
93
false => DefModifiers :: empty ( ) ,
@@ -292,7 +291,7 @@ impl<'a> ::ModuleS<'a> {
292
291
struct ImportResolvingError < ' a > {
293
292
/// Module where the error happened
294
293
source_module : Module < ' a > ,
295
- import_directive : & ' a ImportDirective ,
294
+ import_directive : & ' a ImportDirective < ' a > ,
296
295
span : Span ,
297
296
help : String ,
298
297
}
@@ -424,7 +423,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
424
423
/// don't know whether the name exists at the moment due to other
425
424
/// currently-unresolved imports, or success if we know the name exists.
426
425
/// 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 < ( ) > {
428
427
debug ! ( "(resolving import for module) resolving import `{}::...` in `{}`" ,
429
428
names_to_string( & directive. module_path) ,
430
429
module_to_string( self . resolver. current_module) ) ;
@@ -579,7 +578,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
579
578
// succeeds or bails out (as importing * from an empty module or a module
580
579
// that exports nothing is valid). target_module is the module we are
581
580
// 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 > )
583
582
-> ResolveResult < ( ) > {
584
583
if let Some ( Def :: Trait ( _) ) = target_module. def {
585
584
self . resolver . session . span_err ( directive. span , "items in traits are not importable." ) ;
0 commit comments