@@ -9,7 +9,7 @@ use rustc_hir::intravisit::{
9
9
use rustc_hir:: FnRetTy :: Return ;
10
10
use rustc_hir:: {
11
11
BodyId , FnDecl , GenericArg , GenericBound , GenericParam , GenericParamKind , Generics , ImplItem , ImplItemKind , Item ,
12
- ItemKind , Lifetime , LifetimeName , ParamName , QPath , TraitBoundModifier , TraitItem , TraitItemKind , TraitMethod , Ty ,
12
+ ItemKind , Lifetime , LifetimeName , ParamName , QPath , TraitBoundModifier , TraitFn , TraitItem , TraitItemKind , Ty ,
13
13
TyKind , WhereClause , WherePredicate ,
14
14
} ;
15
15
use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
@@ -86,7 +86,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Lifetimes {
86
86
}
87
87
88
88
fn check_impl_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx ImplItem < ' _ > ) {
89
- if let ImplItemKind :: Method ( ref sig, id) = item. kind {
89
+ if let ImplItemKind :: Fn ( ref sig, id) = item. kind {
90
90
let report_extra_lifetimes = trait_ref_of_method ( cx, item. hir_id ) . is_none ( ) ;
91
91
check_fn_inner (
92
92
cx,
@@ -102,8 +102,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Lifetimes {
102
102
fn check_trait_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx TraitItem < ' _ > ) {
103
103
if let TraitItemKind :: Fn ( ref sig, ref body) = item. kind {
104
104
let body = match * body {
105
- TraitMethod :: Required ( _) => None ,
106
- TraitMethod :: Provided ( id) => Some ( id) ,
105
+ TraitFn :: Required ( _) => None ,
106
+ TraitFn :: Provided ( id) => Some ( id) ,
107
107
} ;
108
108
check_fn_inner ( cx, & sig. decl , body, & item. generics , item. span , true ) ;
109
109
}
0 commit comments