about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-11-09 16:39:21 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-11-15 11:26:02 +0000
commite694ef5f20992514b895493ccf9df0fd851bc715 (patch)
tree06cc5b3767d6e85e6bf79eadbc159fda9df6685f
parentc3c3719fdd1146fcc014cafc0498aa308897e9ee (diff)
downloadrust-e694ef5f20992514b895493ccf9df0fd851bc715.tar.gz
rust-e694ef5f20992514b895493ccf9df0fd851bc715.zip
Remove the fishy need for a PartialEq impl
-rw-r--r--compiler/rustc_hir_typeck/src/method/mod.rs4
-rw-r--r--compiler/rustc_hir_typeck/src/method/probe.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_hir_typeck/src/method/mod.rs b/compiler/rustc_hir_typeck/src/method/mod.rs
index 791a01ef74a..302aaaed34a 100644
--- a/compiler/rustc_hir_typeck/src/method/mod.rs
+++ b/compiler/rustc_hir_typeck/src/method/mod.rs
@@ -202,7 +202,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     call_expr,
                     ProbeScope::TraitsInScope,
                 ) {
-                    Ok(ref new_pick) if *new_pick != pick => {
+                    Ok(ref new_pick) if new_pick.self_ty != pick.self_ty => {
                         needs_mut = true;
                     }
                     _ => {}
@@ -213,7 +213,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             let mut candidates =
                 match self.lookup_probe(segment.ident, self_ty, call_expr, ProbeScope::AllTraits) {
                     // If we find a different result the caller probably forgot to import a trait.
-                    Ok(ref new_pick) if *new_pick != pick => {
+                    Ok(ref new_pick) if new_pick.self_ty != pick.self_ty => {
                         vec![new_pick.item.container_id(self.tcx)]
                     }
                     Err(Ambiguity(ref sources)) => sources
diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs
index eaf1a963ca9..2a1c374e0c2 100644
--- a/compiler/rustc_hir_typeck/src/method/probe.rs
+++ b/compiler/rustc_hir_typeck/src/method/probe.rs
@@ -193,7 +193,7 @@ impl AutorefOrPtrAdjustment {
     }
 }
 
-#[derive(Debug, PartialEq, Clone)]
+#[derive(Debug, Clone)]
 pub struct Pick<'tcx> {
     pub item: ty::AssocItem,
     pub kind: PickKind<'tcx>,