@@ -14,7 +14,7 @@ use rustc_hir::intravisit::{
14
14
} ;
15
15
use rustc_hir:: {
16
16
AmbigArg , BareFnTy , BodyId , FnDecl , FnSig , GenericArg , GenericArgs , GenericBound , GenericParam , GenericParamKind ,
17
- Generics , HirId , Impl , ImplItem , ImplItemKind , Item , ItemKind , Lifetime , LifetimeName , LifetimeParamKind , Node ,
17
+ Generics , HirId , Impl , ImplItem , ImplItemKind , Item , ItemKind , Lifetime , LifetimeKind , LifetimeParamKind , Node ,
18
18
PolyTraitRef , PredicateOrigin , TraitFn , TraitItem , TraitItemKind , Ty , TyKind , WhereBoundPredicate , WherePredicate ,
19
19
WherePredicateKind , lang_items,
20
20
} ;
@@ -218,7 +218,7 @@ fn check_fn_inner<'tcx>(
218
218
for bound in pred. bounds {
219
219
let mut visitor = RefVisitor :: new ( cx) ;
220
220
walk_param_bound ( & mut visitor, bound) ;
221
- if visitor. lts . iter ( ) . any ( |lt| matches ! ( lt. res , LifetimeName :: Param ( _) ) ) {
221
+ if visitor. lts . iter ( ) . any ( |lt| matches ! ( lt. kind , LifetimeKind :: Param ( _) ) ) {
222
222
return ;
223
223
}
224
224
if let GenericBound :: Trait ( ref trait_ref) = * bound {
@@ -235,7 +235,7 @@ fn check_fn_inner<'tcx>(
235
235
_ => None ,
236
236
} ) ;
237
237
for bound in lifetimes {
238
- if bound. res != LifetimeName :: Static && !bound. is_elided ( ) {
238
+ if bound. kind != LifetimeKind :: Static && !bound. is_elided ( ) {
239
239
return ;
240
240
}
241
241
}
@@ -421,8 +421,8 @@ fn named_lifetime_occurrences(lts: &[Lifetime]) -> Vec<(LocalDefId, usize)> {
421
421
}
422
422
423
423
fn named_lifetime ( lt : & Lifetime ) -> Option < LocalDefId > {
424
- match lt. res {
425
- LifetimeName :: Param ( id) if !lt. is_anonymous ( ) => Some ( id) ,
424
+ match lt. kind {
425
+ LifetimeKind :: Param ( id) if !lt. is_anonymous ( ) => Some ( id) ,
426
426
_ => None ,
427
427
}
428
428
}
@@ -614,7 +614,7 @@ where
614
614
615
615
// for lifetimes as parameters of generics
616
616
fn visit_lifetime ( & mut self , lifetime : & ' tcx Lifetime ) {
617
- if let LifetimeName :: Param ( def_id) = lifetime. res
617
+ if let LifetimeKind :: Param ( def_id) = lifetime. kind
618
618
&& let Some ( usages) = self . map . get_mut ( & def_id)
619
619
{
620
620
usages. push ( Usage {
@@ -826,7 +826,7 @@ fn report_elidable_lifetimes(
826
826
. iter ( )
827
827
. map ( |& lt| cx. tcx . def_span ( lt) )
828
828
. chain ( usages. iter ( ) . filter_map ( |usage| {
829
- if let LifetimeName :: Param ( def_id) = usage. res
829
+ if let LifetimeKind :: Param ( def_id) = usage. kind
830
830
&& elidable_lts. contains ( & def_id)
831
831
{
832
832
return Some ( usage. ident . span ) ;
0 commit comments