@@ -9,7 +9,7 @@ use rustc_hir::intravisit::{
99use rustc_hir:: FnRetTy :: Return ;
1010use rustc_hir:: {
1111 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 ,
1313 TyKind , WhereClause , WherePredicate ,
1414} ;
1515use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
@@ -86,7 +86,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Lifetimes {
8686 }
8787
8888 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 {
9090 let report_extra_lifetimes = trait_ref_of_method ( cx, item. hir_id ) . is_none ( ) ;
9191 check_fn_inner (
9292 cx,
@@ -102,8 +102,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Lifetimes {
102102 fn check_trait_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx TraitItem < ' _ > ) {
103103 if let TraitItemKind :: Fn ( ref sig, ref body) = item. kind {
104104 let body = match * body {
105- TraitMethod :: Required ( _) => None ,
106- TraitMethod :: Provided ( id) => Some ( id) ,
105+ TraitFn :: Required ( _) => None ,
106+ TraitFn :: Provided ( id) => Some ( id) ,
107107 } ;
108108 check_fn_inner ( cx, & sig. decl , body, & item. generics , item. span , true ) ;
109109 }
0 commit comments