Syntactically-incorrect suggestion given by Rustc for #[derive()] that does not satisfy trait bounds #91106
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.
rustc
produces a syntactically-invalid fix; namely, it suggests to add a trait bound within the#[derive(...)]
attribute, which does not seem right!impl<T> PartialEq for MyStruct<T>
but only forT: Copy
#[derive(Eq)]
onMyStruct<T>
Given the following code: Rust Playground
The current output is:
The issue is with the
help:
portion:However, if I were to non-judgementally apply the suggestion... 💣💥 Rust Playground
Possilbe resolutions to this issue:
help:
suggestion entirely because of how misleading it ishelp:
suggestion is to remove the#[derive(...)]
and provide an implementation ofEq
manually Rust playgroundThe text was updated successfully, but these errors were encountered: