Suggest implementing #[derive(PartialEq)] for types in vectors and arrays#95371
Conversation
|
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
| } | ||
| } | ||
|
|
||
| if Some(trait_pred.trait_ref.def_id) == self.tcx.lang_items().eq_trait() { |
There was a problem hiding this comment.
Can you leave a comment for what this function does? Also a comment explaining the special casing just for Eq. Alternatively, we could think of some way to generalize this?
There was a problem hiding this comment.
Hmm. In case of PartialOrd, rustc properly explains why xs can't be compared with [X, X, X].
fn main() {
struct X;
let xs = [X, X, X];
let eq = xs > [X, X, X];
}
There was a problem hiding this comment.
Is it possible to implement the PartialEq suggestion by re-using the code for PartialOrd?
There was a problem hiding this comment.
Yes. I'm going to do it.
|
☔ The latest upstream changes (presumably #96459) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@TaKO8Ki any updates on this? |
closes #95285