-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fixed #85845: Added a note in E0369 if the missing trait is PartialEq #85929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
518f643
01996be
a1d18be
96c4539
bcb49dc
afcef43
38830d2
b58393b
207f9b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -959,6 +959,13 @@ fn suggest_impl_missing(err: &mut DiagnosticBuilder<'_>, ty: Ty<'_>, missing_tra | |
"an implementation of `{}` might be missing for `{}`", | ||
missing_trait, ty | ||
)); | ||
// This checks if the missing trait is PartialEq to suggest adding a derive | ||
if missing_trait.ends_with("PartialEq") { | ||
err.note(&format!( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that a span suggestion is better. A note at the end is clearer. Why do you want a span_suggestion? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you want to suggest adding a |
||
"add `#[derive(PartialEq)]` or manually implement `PartialEq` for `{}`", | ||
ty | ||
)); | ||
} | ||
} | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.