@@ -505,7 +505,7 @@ enum MaybeExported<'a> {
505
505
}
506
506
507
507
impl MaybeExported < ' _ > {
508
- fn eval ( self , r : & Resolver < ' _ > ) -> bool {
508
+ fn eval ( self , r : & Resolver < ' _ , ' _ > ) -> bool {
509
509
let def_id = match self {
510
510
MaybeExported :: Ok ( node_id) => Some ( r. local_def_id ( node_id) ) ,
511
511
MaybeExported :: Impl ( Some ( trait_def_id) ) | MaybeExported :: ImplItem ( Ok ( trait_def_id) ) => {
@@ -584,8 +584,8 @@ struct DiagnosticMetadata<'ast> {
584
584
current_elision_failures : Vec < MissingLifetime > ,
585
585
}
586
586
587
- struct LateResolutionVisitor < ' a , ' b , ' ast > {
588
- r : & ' b mut Resolver < ' a > ,
587
+ struct LateResolutionVisitor < ' a , ' b , ' ast , ' tcx > {
588
+ r : & ' b mut Resolver < ' a , ' tcx > ,
589
589
590
590
/// The module that represents the current item scope.
591
591
parent_scope : ParentScope < ' a > ,
@@ -628,7 +628,7 @@ struct LateResolutionVisitor<'a, 'b, 'ast> {
628
628
}
629
629
630
630
/// Walks the whole crate in DFS order, visiting each item, resolving names as it goes.
631
- impl < ' a : ' ast , ' ast > Visitor < ' ast > for LateResolutionVisitor < ' a , ' _ , ' ast > {
631
+ impl < ' a : ' ast , ' ast , ' tcx > Visitor < ' ast > for LateResolutionVisitor < ' a , ' _ , ' ast , ' tcx > {
632
632
fn visit_attribute ( & mut self , _: & ' ast Attribute ) {
633
633
// We do not want to resolve expressions that appear in attributes,
634
634
// as they do not correspond to actual code.
@@ -1199,8 +1199,8 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
1199
1199
}
1200
1200
}
1201
1201
1202
- impl < ' a : ' ast , ' b , ' ast > LateResolutionVisitor < ' a , ' b , ' ast > {
1203
- fn new ( resolver : & ' b mut Resolver < ' a > ) -> LateResolutionVisitor < ' a , ' b , ' ast > {
1202
+ impl < ' a : ' ast , ' b , ' ast , ' tcx > LateResolutionVisitor < ' a , ' b , ' ast , ' tcx > {
1203
+ fn new ( resolver : & ' b mut Resolver < ' a , ' tcx > ) -> LateResolutionVisitor < ' a , ' b , ' ast , ' tcx > {
1204
1204
// During late resolution we only track the module component of the parent scope,
1205
1205
// although it may be useful to track other components as well for diagnostics.
1206
1206
let graph_root = resolver. graph_root ;
@@ -2029,13 +2029,13 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2029
2029
2030
2030
/// List all the lifetimes that appear in the provided type.
2031
2031
fn find_lifetime_for_self ( & self , ty : & ' ast Ty ) -> Set1 < LifetimeRes > {
2032
- struct SelfVisitor < ' r , ' a > {
2033
- r : & ' r Resolver < ' a > ,
2032
+ struct SelfVisitor < ' r , ' a , ' tcx > {
2033
+ r : & ' r Resolver < ' a , ' tcx > ,
2034
2034
impl_self : Option < Res > ,
2035
2035
lifetime : Set1 < LifetimeRes > ,
2036
2036
}
2037
2037
2038
- impl SelfVisitor < ' _ , ' _ > {
2038
+ impl SelfVisitor < ' _ , ' _ , ' _ > {
2039
2039
// Look for `self: &'a Self` - also desugared from `&'a self`,
2040
2040
// and if that matches, use it for elision and return early.
2041
2041
fn is_self_ty ( & self , ty : & Ty ) -> bool {
@@ -2053,7 +2053,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2053
2053
}
2054
2054
}
2055
2055
2056
- impl < ' a > Visitor < ' a > for SelfVisitor < ' _ , ' _ > {
2056
+ impl < ' a > Visitor < ' a > for SelfVisitor < ' _ , ' _ , ' _ > {
2057
2057
fn visit_ty ( & mut self , ty : & ' a Ty ) {
2058
2058
trace ! ( "SelfVisitor considering ty={:?}" , ty) ;
2059
2059
if let TyKind :: Ref ( lt, ref mt) = ty. kind && self . is_self_ty ( & mt. ty ) {
@@ -4288,13 +4288,13 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
4288
4288
}
4289
4289
}
4290
4290
4291
- struct LifetimeCountVisitor < ' a , ' b > {
4292
- r : & ' b mut Resolver < ' a > ,
4291
+ struct LifetimeCountVisitor < ' a , ' b , ' tcx > {
4292
+ r : & ' b mut Resolver < ' a , ' tcx > ,
4293
4293
}
4294
4294
4295
4295
/// Walks the whole crate in DFS order, visiting each item, counting the declared number of
4296
4296
/// lifetime generic parameters.
4297
- impl < ' ast > Visitor < ' ast > for LifetimeCountVisitor < ' _ , ' _ > {
4297
+ impl < ' ast > Visitor < ' ast > for LifetimeCountVisitor < ' _ , ' _ , ' _ > {
4298
4298
fn visit_item ( & mut self , item : & ' ast Item ) {
4299
4299
match & item. kind {
4300
4300
ItemKind :: TyAlias ( box TyAlias { ref generics, .. } )
@@ -4328,7 +4328,7 @@ impl<'ast> Visitor<'ast> for LifetimeCountVisitor<'_, '_> {
4328
4328
}
4329
4329
}
4330
4330
4331
- impl < ' a > Resolver < ' a > {
4331
+ impl < ' a , ' tcx > Resolver < ' a , ' tcx > {
4332
4332
pub ( crate ) fn late_resolve_crate ( & mut self , krate : & Crate ) {
4333
4333
visit:: walk_crate ( & mut LifetimeCountVisitor { r : self } , krate) ;
4334
4334
let mut late_resolution_visitor = LateResolutionVisitor :: new ( self ) ;
0 commit comments