Skip to content

Commit dcf064a

Browse files
committed
Rename "Associated*" to "Assoc*"
This is to fix the breakage introduced by rust-lang/rust#60163.
1 parent a8eeb7c commit dcf064a

6 files changed

+11
-11
lines changed

clippy_lints/src/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
326326

327327
let res = self.tables.qpath_res(qpath, id);
328328
match res {
329-
Res::Def(DefKind::Const, def_id) | Res::Def(DefKind::AssociatedConst, def_id) => {
329+
Res::Def(DefKind::Const, def_id) | Res::Def(DefKind::AssocConst, def_id) => {
330330
let substs = self.tables.node_substs(id);
331331
let substs = if self.substs.is_empty() {
332332
substs

clippy_lints/src/len_zero.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
120120
fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items: &[TraitItemRef]) {
121121
fn is_named_self(cx: &LateContext<'_, '_>, item: &TraitItemRef, name: &str) -> bool {
122122
item.ident.name.as_str() == name
123-
&& if let AssociatedItemKind::Method { has_self } = item.kind {
123+
&& if let AssocItemKind::Method { has_self } = item.kind {
124124
has_self && {
125125
let did = cx.tcx.hir().local_def_id_from_hir_id(item.id.hir_id);
126126
cx.tcx.fn_sig(did).inputs().skip_binder().len() == 1
@@ -148,7 +148,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items
148148
.iter()
149149
.flat_map(|&i| cx.tcx.associated_items(i))
150150
.any(|i| {
151-
i.kind == ty::AssociatedKind::Method
151+
i.kind == ty::AssocKind::Method
152152
&& i.method_has_self_argument
153153
&& i.ident.name == sym!(is_empty)
154154
&& cx.tcx.fn_sig(i.def_id).inputs().skip_binder().len() == 1
@@ -171,7 +171,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items
171171
fn check_impl_items(cx: &LateContext<'_, '_>, item: &Item, impl_items: &[ImplItemRef]) {
172172
fn is_named_self(cx: &LateContext<'_, '_>, item: &ImplItemRef, name: &str) -> bool {
173173
item.ident.name.as_str() == name
174-
&& if let AssociatedItemKind::Method { has_self } = item.kind {
174+
&& if let AssocItemKind::Method { has_self } = item.kind {
175175
has_self && {
176176
let did = cx.tcx.hir().local_def_id_from_hir_id(item.id.hir_id);
177177
cx.tcx.fn_sig(did).inputs().skip_binder().len() == 1
@@ -258,9 +258,9 @@ fn check_len(
258258

259259
/// Checks if this type has an `is_empty` method.
260260
fn has_is_empty(cx: &LateContext<'_, '_>, expr: &Expr) -> bool {
261-
/// Gets an `AssociatedItem` and return true if it matches `is_empty(self)`.
262-
fn is_is_empty(cx: &LateContext<'_, '_>, item: &ty::AssociatedItem) -> bool {
263-
if let ty::AssociatedKind::Method = item.kind {
261+
/// Gets an `AssocItem` and return true if it matches `is_empty(self)`.
262+
fn is_is_empty(cx: &LateContext<'_, '_>, item: &ty::AssocItem) -> bool {
263+
if let ty::AssocKind::Method = item.kind {
264264
if item.ident.name.as_str() == "is_empty" {
265265
let sig = cx.tcx.fn_sig(item.def_id);
266266
let ty = sig.skip_binder();

clippy_lints/src/new_without_default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
9595
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
9696
if let hir::ItemKind::Impl(_, _, _, _, None, _, ref items) = item.node {
9797
for assoc_item in items {
98-
if let hir::AssociatedItemKind::Method { has_self: false } = assoc_item.kind {
98+
if let hir::AssocItemKind::Method { has_self: false } = assoc_item.kind {
9999
let impl_item = cx.tcx.hir().impl_item(assoc_item.id);
100100
if in_external_macro(cx.sess(), impl_item.span) {
101101
return;

clippy_lints/src/non_copy_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst {
195195

196196
// Make sure it is a const item.
197197
match cx.tables.qpath_res(qpath, expr.hir_id) {
198-
Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssociatedConst, _) => {},
198+
Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssocConst, _) => {},
199199
_ => return,
200200
};
201201

clippy_lints/src/trivially_copy_pass_by_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<'a, 'tcx> TriviallyCopyPassByRef {
130130

131131
fn check_trait_items(&mut self, cx: &LateContext<'_, '_>, trait_items: &[TraitItemRef]) {
132132
for item in trait_items {
133-
if let AssociatedItemKind::Method { .. } = item.kind {
133+
if let AssocItemKind::Method { .. } = item.kind {
134134
self.check_trait_method(cx, item);
135135
}
136136
}

clippy_lints/src/use_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn check_trait_method_impl_decl<'a, 'tcx: 'a>(
119119
.tcx
120120
.associated_items(impl_trait_ref.def_id)
121121
.find(|assoc_item| {
122-
assoc_item.kind == ty::AssociatedKind::Method
122+
assoc_item.kind == ty::AssocKind::Method
123123
&& cx
124124
.tcx
125125
.hygienic_eq(impl_item.ident, assoc_item.ident, impl_trait_ref.def_id)

0 commit comments

Comments
 (0)