]> git.lizzy.rs Git - rust.git/commitdiff
Rename "Associated*" to "Assoc*"
authorAndrew Xu <andrewxuyuan@gmail.com>
Sat, 25 May 2019 12:31:34 +0000 (20:31 +0800)
committerAndrew Xu <andrewxuyuan@gmail.com>
Sat, 25 May 2019 12:31:34 +0000 (20:31 +0800)
This is to fix the breakage introduced by rust-lang/rust#60163.

clippy_lints/src/consts.rs
clippy_lints/src/len_zero.rs
clippy_lints/src/new_without_default.rs
clippy_lints/src/non_copy_const.rs
clippy_lints/src/trivially_copy_pass_by_ref.rs
clippy_lints/src/use_self.rs

index cbc10768bbc1604dc7b24e0fd395750a5616a9cd..a8004ddc2708f7bcf6070ef27c8f2edfa02ffefe 100644 (file)
@@ -326,7 +326,7 @@ fn fetch_path(&mut self, qpath: &QPath, id: HirId) -> Option<Constant> {
 
         let res = self.tables.qpath_res(qpath, id);
         match res {
-            Res::Def(DefKind::Const, def_id) | Res::Def(DefKind::AssociatedConst, def_id) => {
+            Res::Def(DefKind::Const, def_id) | Res::Def(DefKind::AssocConst, def_id) => {
                 let substs = self.tables.node_substs(id);
                 let substs = if self.substs.is_empty() {
                     substs
index 624e5eabff0584528a1586e1fe3be082975a697a..3dc0765c6373e677273681dcd8d14a6636fa2a71 100644 (file)
@@ -120,7 +120,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
 fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items: &[TraitItemRef]) {
     fn is_named_self(cx: &LateContext<'_, '_>, item: &TraitItemRef, name: &str) -> bool {
         item.ident.name.as_str() == name
-            && if let AssociatedItemKind::Method { has_self } = item.kind {
+            && if let AssocItemKind::Method { has_self } = item.kind {
                 has_self && {
                     let did = cx.tcx.hir().local_def_id_from_hir_id(item.id.hir_id);
                     cx.tcx.fn_sig(did).inputs().skip_binder().len() == 1
@@ -148,7 +148,7 @@ fn fill_trait_set(traitt: DefId, set: &mut FxHashSet<DefId>, cx: &LateContext<'_
             .iter()
             .flat_map(|&i| cx.tcx.associated_items(i))
             .any(|i| {
-                i.kind == ty::AssociatedKind::Method
+                i.kind == ty::AssocKind::Method
                     && i.method_has_self_argument
                     && i.ident.name == sym!(is_empty)
                     && cx.tcx.fn_sig(i.def_id).inputs().skip_binder().len() == 1
@@ -171,7 +171,7 @@ fn fill_trait_set(traitt: DefId, set: &mut FxHashSet<DefId>, cx: &LateContext<'_
 fn check_impl_items(cx: &LateContext<'_, '_>, item: &Item, impl_items: &[ImplItemRef]) {
     fn is_named_self(cx: &LateContext<'_, '_>, item: &ImplItemRef, name: &str) -> bool {
         item.ident.name.as_str() == name
-            && if let AssociatedItemKind::Method { has_self } = item.kind {
+            && if let AssocItemKind::Method { has_self } = item.kind {
                 has_self && {
                     let did = cx.tcx.hir().local_def_id_from_hir_id(item.id.hir_id);
                     cx.tcx.fn_sig(did).inputs().skip_binder().len() == 1
@@ -258,9 +258,9 @@ fn check_len(
 
 /// Checks if this type has an `is_empty` method.
 fn has_is_empty(cx: &LateContext<'_, '_>, expr: &Expr) -> bool {
-    /// Gets an `AssociatedItem` and return true if it matches `is_empty(self)`.
-    fn is_is_empty(cx: &LateContext<'_, '_>, item: &ty::AssociatedItem) -> bool {
-        if let ty::AssociatedKind::Method = item.kind {
+    /// Gets an `AssocItem` and return true if it matches `is_empty(self)`.
+    fn is_is_empty(cx: &LateContext<'_, '_>, item: &ty::AssocItem) -> bool {
+        if let ty::AssocKind::Method = item.kind {
             if item.ident.name.as_str() == "is_empty" {
                 let sig = cx.tcx.fn_sig(item.def_id);
                 let ty = sig.skip_binder();
index e325f0e70fde45ee121e0ed0a27511bdc59debb6..747548328264c691423de3c254ea7368878de0de 100644 (file)
@@ -95,7 +95,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
     fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
         if let hir::ItemKind::Impl(_, _, _, _, None, _, ref items) = item.node {
             for assoc_item in items {
-                if let hir::AssociatedItemKind::Method { has_self: false } = assoc_item.kind {
+                if let hir::AssocItemKind::Method { has_self: false } = assoc_item.kind {
                     let impl_item = cx.tcx.hir().impl_item(assoc_item.id);
                     if in_external_macro(cx.sess(), impl_item.span) {
                         return;
index 2d56b4ee8b4e1ab6ac4a85da2a03f4823401a687..2652e5e75d33de8f3ec68437f1f79b65066bb356 100644 (file)
@@ -195,7 +195,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
 
             // Make sure it is a const item.
             match cx.tables.qpath_res(qpath, expr.hir_id) {
-                Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssociatedConst, _) => {},
+                Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssocConst, _) => {},
                 _ => return,
             };
 
index 9866540220d2d5959b73c536cc258b97ca845075..3082c368e41d4a1c86f4cd2d3840293c15936806 100644 (file)
@@ -130,7 +130,7 @@ fn check_poly_fn(&mut self, cx: &LateContext<'_, 'tcx>, decl: &FnDecl, sig: &FnS
 
     fn check_trait_items(&mut self, cx: &LateContext<'_, '_>, trait_items: &[TraitItemRef]) {
         for item in trait_items {
-            if let AssociatedItemKind::Method { .. } = item.kind {
+            if let AssocItemKind::Method { .. } = item.kind {
                 self.check_trait_method(cx, item);
             }
         }
index 1a0a3474d88b274b34a4ebbc7d6f50a75f04231b..992422ae4e30cf860dd5792ea666e5e034e0b2f3 100644 (file)
@@ -119,7 +119,7 @@ fn check_trait_method_impl_decl<'a, 'tcx: 'a>(
         .tcx
         .associated_items(impl_trait_ref.def_id)
         .find(|assoc_item| {
-            assoc_item.kind == ty::AssociatedKind::Method
+            assoc_item.kind == ty::AssocKind::Method
                 && cx
                     .tcx
                     .hygienic_eq(impl_item.ident, assoc_item.ident, impl_trait_ref.def_id)