Remove the fishy need for a PartialEq impl

This commit is contained in:
Oli Scherer 2022-11-09 16:39:21 +00:00
parent c3c3719fdd
commit e694ef5f20
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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>,