about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2020-04-10 19:03:34 +0200
committerPhilipp Hansch <dev@phansch.net>2020-04-10 19:03:34 +0200
commit3ef1dab211f92b238fda40749fa5602521d7af10 (patch)
tree14f6f330059d63605687b83df34ee0acf04b3465
parent34763a5f3632b1d9081ba0245a729174996f0b38 (diff)
downloadrust-3ef1dab211f92b238fda40749fa5602521d7af10.tar.gz
rust-3ef1dab211f92b238fda40749fa5602521d7af10.zip
Rustup to https://github.com/rust-lang/rust/pull/70913
-rw-r--r--clippy_lints/src/methods/mod.rs6
-rw-r--r--clippy_lints/src/types.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index be9b369112a..bab3cf8ecb1 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -3425,12 +3425,12 @@ enum SelfKind {
 
 impl SelfKind {
     fn matches<'a>(self, cx: &LateContext<'_, 'a>, parent_ty: Ty<'a>, ty: Ty<'a>) -> bool {
-        fn matches_value(parent_ty: Ty<'_>, ty: Ty<'_>) -> bool {
+        fn matches_value<'a>(cx: &LateContext<'_, 'a>, parent_ty: Ty<'_>, ty: Ty<'_>) -> bool {
             if ty == parent_ty {
                 true
             } else if ty.is_box() {
                 ty.boxed_ty() == parent_ty
-            } else if ty.is_rc() || ty.is_arc() {
+            } else if is_type_diagnostic_item(cx, ty, sym::Rc) || is_type_diagnostic_item(cx, ty, sym::Arc) {
                 if let ty::Adt(_, substs) = ty.kind {
                     substs.types().next().map_or(false, |t| t == parent_ty)
                 } else {
@@ -3464,7 +3464,7 @@ impl SelfKind {
         }
 
         match self {
-            Self::Value => matches_value(parent_ty, ty),
+            Self::Value => matches_value(cx, parent_ty, ty),
             Self::Ref => matches_ref(cx, hir::Mutability::Not, parent_ty, ty) || ty == parent_ty && is_copy(cx, ty),
             Self::RefMut => matches_ref(cx, hir::Mutability::Mut, parent_ty, ty),
             Self::No => ty != parent_ty,
diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs
index 1e7e0adf390..67399fb6468 100644
--- a/clippy_lints/src/types.rs
+++ b/clippy_lints/src/types.rs
@@ -347,7 +347,7 @@ impl Types {
                             );
                             return; // don't recurse into the type
                         }
-                    } else if Some(def_id) == cx.tcx.lang_items().rc() {
+                    } else if cx.tcx.is_diagnostic_item(sym::Rc, def_id) {
                         if let Some(span) = match_type_parameter(cx, qpath, &paths::RC) {
                             span_lint_and_sugg(
                                 cx,