@@ -6,12 +6,12 @@ use rustc_errors::Applicability;
6
6
use rustc_hir:: FnRetTy :: Return ;
7
7
use rustc_hir:: intravisit:: nested_filter:: { self as hir_nested_filter, NestedFilter } ;
8
8
use rustc_hir:: intravisit:: {
9
- Visitor , walk_fn_decl, walk_generic_arg , walk_generics, walk_impl_item_ref, walk_item, walk_param_bound,
9
+ Visitor , walk_fn_decl, walk_generic_args , walk_generics, walk_impl_item_ref, walk_item, walk_param_bound,
10
10
walk_poly_trait_ref, walk_trait_ref, walk_ty, walk_where_predicate,
11
11
} ;
12
12
use rustc_hir:: {
13
- BareFnTy , BodyId , FnDecl , FnSig , GenericArg , GenericBound , GenericParam , GenericParamKind , Generics , Impl ,
14
- ImplItem , ImplItemKind , Item , ItemKind , Lifetime , LifetimeName , LifetimeParamKind , Node , PolyTraitRef ,
13
+ BareFnTy , BodyId , FnDecl , FnSig , GenericArg , GenericArgs , GenericBound , GenericParam , GenericParamKind , Generics ,
14
+ Impl , ImplItem , ImplItemKind , Item , ItemKind , Lifetime , LifetimeName , LifetimeParamKind , Node , PolyTraitRef ,
15
15
PredicateOrigin , TraitFn , TraitItem , TraitItemKind , Ty , TyKind , WherePredicate , lang_items,
16
16
} ;
17
17
use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
@@ -494,14 +494,14 @@ fn has_where_lifetimes<'tcx>(cx: &LateContext<'tcx>, generics: &'tcx Generics<'_
494
494
struct Usage {
495
495
lifetime : Lifetime ,
496
496
in_where_predicate : bool ,
497
- in_generic_arg : bool ,
497
+ in_generics_arg : bool ,
498
498
}
499
499
500
500
struct LifetimeChecker < ' cx , ' tcx , F > {
501
501
cx : & ' cx LateContext < ' tcx > ,
502
502
map : FxHashMap < LocalDefId , Vec < Usage > > ,
503
503
where_predicate_depth : usize ,
504
- generic_arg_depth : usize ,
504
+ generic_args_depth : usize ,
505
505
phantom : std:: marker:: PhantomData < F > ,
506
506
}
507
507
@@ -512,7 +512,7 @@ impl<'cx, 'tcx, F> LifetimeChecker<'cx, 'tcx, F> {
512
512
cx,
513
513
map,
514
514
where_predicate_depth : 0 ,
515
- generic_arg_depth : 0 ,
515
+ generic_args_depth : 0 ,
516
516
phantom : std:: marker:: PhantomData ,
517
517
}
518
518
}
@@ -533,7 +533,7 @@ where
533
533
usages. push ( Usage {
534
534
lifetime : * lifetime,
535
535
in_where_predicate : self . where_predicate_depth != 0 ,
536
- in_generic_arg : self . generic_arg_depth != 0 ,
536
+ in_generics_arg : self . generic_args_depth != 0 ,
537
537
} ) ;
538
538
}
539
539
}
@@ -544,10 +544,10 @@ where
544
544
self . where_predicate_depth -= 1 ;
545
545
}
546
546
547
- fn visit_generic_arg ( & mut self , generic_arg : & ' tcx GenericArg < ' tcx > ) -> Self :: Result {
548
- self . generic_arg_depth += 1 ;
549
- walk_generic_arg ( self , generic_arg ) ;
550
- self . generic_arg_depth -= 1 ;
547
+ fn visit_generic_args ( & mut self , generic_args : & ' tcx GenericArgs < ' tcx > ) -> Self :: Result {
548
+ self . generic_args_depth += 1 ;
549
+ walk_generic_args ( self , generic_args ) ;
550
+ self . generic_args_depth -= 1 ;
551
551
}
552
552
553
553
fn nested_visit_map ( & mut self ) -> Self :: Map {
@@ -574,7 +574,7 @@ fn report_extra_lifetimes<'tcx>(cx: &LateContext<'tcx>, func: &'tcx FnDecl<'_>,
574
574
for ( def_id, usages) in checker. map {
575
575
if usages
576
576
. iter ( )
577
- . all ( |usage| usage. in_where_predicate && !usage. in_generic_arg )
577
+ . all ( |usage| usage. in_where_predicate && !usage. in_generics_arg )
578
578
{
579
579
span_lint (
580
580
cx,
@@ -612,7 +612,7 @@ fn report_extra_impl_lifetimes<'tcx>(cx: &LateContext<'tcx>, impl_: &'tcx Impl<'
612
612
for ( & def_id, usages) in & checker. map {
613
613
if usages
614
614
. iter ( )
615
- . all ( |usage| usage. in_where_predicate && !usage. in_generic_arg )
615
+ . all ( |usage| usage. in_where_predicate && !usage. in_generics_arg )
616
616
{
617
617
span_lint (
618
618
cx,
@@ -646,7 +646,7 @@ fn report_elidable_impl_lifetimes<'tcx>(
646
646
}
647
647
| Usage {
648
648
lifetime,
649
- in_generic_arg : false ,
649
+ in_generics_arg : false ,
650
650
..
651
651
} ,
652
652
] = usages. as_slice ( )
0 commit comments