@@ -121,7 +121,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
121121fn check_trait_items ( cx : & LateContext < ' _ , ' _ > , visited_trait : & Item < ' _ > , trait_items : & [ TraitItemRef ] ) {
122122 fn is_named_self ( cx : & LateContext < ' _ , ' _ > , item : & TraitItemRef , name : & str ) -> bool {
123123 item. ident . name . as_str ( ) == name
124- && if let AssocItemKind :: Method { has_self } = item. kind {
124+ && if let AssocItemKind :: Fn { has_self } = item. kind {
125125 has_self && {
126126 let did = cx. tcx . hir ( ) . local_def_id ( item. id . hir_id ) ;
127127 cx. tcx . fn_sig ( did) . inputs ( ) . skip_binder ( ) . len ( ) == 1
@@ -149,8 +149,8 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item<'_>, trait_i
149149 . iter ( )
150150 . flat_map ( |& i| cx. tcx . associated_items ( i) . in_definition_order ( ) )
151151 . any ( |i| {
152- i. kind == ty:: AssocKind :: Method
153- && i. method_has_self_argument
152+ i. kind == ty:: AssocKind :: Fn
153+ && i. fn_has_self_parameter
154154 && i. ident . name == sym ! ( is_empty)
155155 && cx. tcx . fn_sig ( i. def_id ) . inputs ( ) . skip_binder ( ) . len ( ) == 1
156156 } ) ;
@@ -172,7 +172,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item<'_>, trait_i
172172fn check_impl_items ( cx : & LateContext < ' _ , ' _ > , item : & Item < ' _ > , impl_items : & [ ImplItemRef < ' _ > ] ) {
173173 fn is_named_self ( cx : & LateContext < ' _ , ' _ > , item : & ImplItemRef < ' _ > , name : & str ) -> bool {
174174 item. ident . name . as_str ( ) == name
175- && if let AssocItemKind :: Method { has_self } = item. kind {
175+ && if let AssocItemKind :: Fn { has_self } = item. kind {
176176 has_self && {
177177 let did = cx. tcx . hir ( ) . local_def_id ( item. id . hir_id ) ;
178178 cx. tcx . fn_sig ( did) . inputs ( ) . skip_binder ( ) . len ( ) == 1
@@ -261,7 +261,7 @@ fn check_len(
261261fn has_is_empty ( cx : & LateContext < ' _ , ' _ > , expr : & Expr < ' _ > ) -> bool {
262262 /// Gets an `AssocItem` and return true if it matches `is_empty(self)`.
263263 fn is_is_empty ( cx : & LateContext < ' _ , ' _ > , item : & ty:: AssocItem ) -> bool {
264- if let ty:: AssocKind :: Method = item. kind {
264+ if let ty:: AssocKind :: Fn = item. kind {
265265 if item. ident . name . as_str ( ) == "is_empty" {
266266 let sig = cx. tcx . fn_sig ( item. def_id ) ;
267267 let ty = sig. skip_binder ( ) ;
0 commit comments