-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Suggest PartialEq
bound for binary operation ==
error
#73416
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
tesuji
changed the title
Suggest
Suggest Jun 16, 2020
PartialEq
bounds for "==" errorPartialEq
bound for "==" error
tesuji
changed the title
Suggest
Suggest Jun 16, 2020
PartialEq
bound for "==" errorPartialEq
bound for binary operation ==
error
jonas-schievink
added
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jun 16, 2020
estebank
added
the
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
label
Jun 16, 2020
related: #73261 |
Note: The stderr for Rust 1.42 and below: error[E0369]: binary operation `==` cannot be applied to type `&[T]`
--> <source>:8:17
|
8 | if head == prefix {
| ---- ^^ ------ &[T]
| |
| &[T]
|
= note: an implementation of `std::cmp::PartialEq` might be missing for `&[T]` |
Yep. The ideal output would be something along the lines of
|
Merged
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jun 26, 2020
… r=davidtwco Tweak binop errors * Suggest potentially missing binop trait bound (fix rust-lang#73416) * Use structured suggestion for dereference in binop
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jun 26, 2020
… r=davidtwco Tweak binop errors * Suggest potentially missing binop trait bound (fix rust-lang#73416) * Use structured suggestion for dereference in binop
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Try this snippet: playground
The compiler errors out:
It would be nice if the compiler could suggest adding
PartialEq
bound forT
.The text was updated successfully, but these errors were encountered: