Skip to content

Commit 01996be

Browse files
committed
Updated the fix for rust-lang#85845
- Made the check stricter. **Note: I've checked and there is no other trait that can be possibly passed than std ones. (BinOps) so there is no need for a `can_derive` or something similar. Furthermore, this mean we can't pass another thing than a str.**
1 parent 518f643 commit 01996be

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_typeck/src/check

1 file changed

+1
-1
lines changed

Diff for: compiler/rustc_typeck/src/check/op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ fn suggest_impl_missing(err: &mut DiagnosticBuilder<'_>, ty: Ty<'_>, missing_tra
960960
missing_trait, ty
961961
));
962962
// This checks if the missing trait is PartialEq to suggest adding a derive
963-
if missing_trait.ends_with("PartialEq") {
963+
if missing_trait.ends_with("std::cmp::PartialEq") {
964964
err.note(&format!(
965965
"add `#[derive(PartialEq)]` or manually implement `PartialEq` for `{}`",
966966
ty

0 commit comments

Comments
 (0)