diff --git a/compiler/rustc_typeck/src/check/op.rs b/compiler/rustc_typeck/src/check/op.rs index 564d7a07630c9..8a758c74b2af1 100644 --- a/compiler/rustc_typeck/src/check/op.rs +++ b/compiler/rustc_typeck/src/check/op.rs @@ -960,7 +960,7 @@ fn suggest_impl_missing(err: &mut DiagnosticBuilder<'_>, ty: Ty<'_>, missing_tra missing_trait, ty )); // This checks if the missing trait is PartialEq to suggest adding a derive - if missing_trait.ends_with("PartialEq") { + if missing_trait.ends_with("std::cmp::PartialEq") { err.note(&format!( "add `#[derive(PartialEq)]` or manually implement `PartialEq` for `{}`", ty