Add missing reverse PartialEq impls for Cow - #160973
Conversation
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @clarfonthey (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
Vec, &[T] and &mut [T] already implement PartialEq against Cow<'_, [U]>, but the reverse direction is missing, so `vec == cow`, `slice == cow` and `mut_slice == cow` all fail to compile. Add the three reverse impls to fill the remaining gap from issue 152830, which was partially addressed by the recent VecDeque companion PR 152972.
86bb69c to
b3383b6
Compare
This comment has been minimized.
This comment has been minimized.
Adding `impl PartialEq<Cow<'_, [U]>>` for `&[T]` and `&mut [T]` shifts the trait help message in two UI tests, which now list the new impls and push two older entries into "N others": - tests/ui/consts/too_generic_eval_ice.current.stderr - tests/ui/macros/assert-ne-no-invalid-help-issue-146204.stderr No source changes; only the expected stderr snapshots were regenerated.
|
I remember mentioning this during the libs meaning, but don't actually remember why it came up since this isn't nominated. My general opinion is we should have these, but I do question whether they weren't added initially because of inference failures, and not just because we forgot them. So, it makes sense to do a crater run first. @bors try |
This comment has been minimized.
This comment has been minimized.
Add missing reverse PartialEq impls for Cow
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
☔ The latest upstream changes (presumably #161566) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
|
FWIW: The crater runs are delayed since the release crater runs are the ones that are prioritised right now. I don't think we need to cancel the running job since it'll still be useful for whether these impls specifically cause regressions. |
|
Closing — #156160 (which went in via #161566) added the same impls, so this is no longer needed. Thanks to @clarfonthey for the review and the crater run, sorry for the churn. |
Closes #152830
Implements the Cow-related cases that #152972 doesn't cover:
Without these, expressions like
vec == coworslice == cowfail to compile.