@@ -121,7 +121,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
121
121
fn check_trait_items ( cx : & LateContext < ' _ , ' _ > , visited_trait : & Item < ' _ > , trait_items : & [ TraitItemRef ] ) {
122
122
fn is_named_self ( cx : & LateContext < ' _ , ' _ > , item : & TraitItemRef , name : & str ) -> bool {
123
123
item. ident . name . as_str ( ) == name
124
- && if let AssocItemKind :: Method { has_self } = item. kind {
124
+ && if let AssocItemKind :: Fn { has_self } = item. kind {
125
125
has_self && {
126
126
let did = cx. tcx . hir ( ) . local_def_id ( item. id . hir_id ) ;
127
127
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
149
149
. iter ( )
150
150
. flat_map ( |& i| cx. tcx . associated_items ( i) . in_definition_order ( ) )
151
151
. 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
154
154
&& i. ident . name == sym ! ( is_empty)
155
155
&& cx. tcx . fn_sig ( i. def_id ) . inputs ( ) . skip_binder ( ) . len ( ) == 1
156
156
} ) ;
@@ -172,7 +172,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item<'_>, trait_i
172
172
fn check_impl_items ( cx : & LateContext < ' _ , ' _ > , item : & Item < ' _ > , impl_items : & [ ImplItemRef < ' _ > ] ) {
173
173
fn is_named_self ( cx : & LateContext < ' _ , ' _ > , item : & ImplItemRef < ' _ > , name : & str ) -> bool {
174
174
item. ident . name . as_str ( ) == name
175
- && if let AssocItemKind :: Method { has_self } = item. kind {
175
+ && if let AssocItemKind :: Fn { has_self } = item. kind {
176
176
has_self && {
177
177
let did = cx. tcx . hir ( ) . local_def_id ( item. id . hir_id ) ;
178
178
cx. tcx . fn_sig ( did) . inputs ( ) . skip_binder ( ) . len ( ) == 1
@@ -261,7 +261,7 @@ fn check_len(
261
261
fn has_is_empty ( cx : & LateContext < ' _ , ' _ > , expr : & Expr < ' _ > ) -> bool {
262
262
/// Gets an `AssocItem` and return true if it matches `is_empty(self)`.
263
263
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 {
265
265
if item. ident . name . as_str ( ) == "is_empty" {
266
266
let sig = cx. tcx . fn_sig ( item. def_id ) ;
267
267
let ty = sig. skip_binder ( ) ;
0 commit comments