Vec<T> implements PartialEq<[T; N]> but the other way round doesn't work #125243
Labels
C-bug
Category: This is a bug.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Hello,
it seems that there is an oversight (or possibly it's wanted behaviour, but it felt odd to me) in how vectors and arrays can be compared, based on
PartialEq
implementation.I tried this code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3c95d140909d5ac62d769b8f663bcd47
I expected to see this happen: No errors because
assert_eq
should consider these two equal (or shouldn't it?)Instead, this happened:
Meta
I also checked beta and nightly (on the playground, not on my own machine; please tell me if I should repeat it here), and the results are the same over all three of these.
rustc --version --verbose
:Backtrace
(I did activate RUST_BACKTRACE=1 but the output was the same as before with the other runs)
The text was updated successfully, but these errors were encountered: