binary operators hide "trait bounds not satisfied" errors #125631
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
usually, when calling a trait method on a complex type that requires its member types to implement a specific trait, a "the following trait bounds were not satisfied" message will be printed, showing which member type does not implement the required trait.
however, since binary operations have their own unique error message, they completely hide this info.
although, if the member type that does not implement the trait is defined in the current crate, rustc will note that type, and say it might be missing a PartialEq impl. it's only with foreign types where no additional output is shown.
this is particularly confusing when trying to compare an io::Result in unit tests.
additionally, the fact that the error message is completely different, and doesn't mention traits at all, is especially confusing.
Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: