Add missing impl PartialEq<Vec<T>> for [T; N]#153249
Closed
Not-Sarthak wants to merge 2 commits intorust-lang:mainfrom
Closed
Add missing impl PartialEq<Vec<T>> for [T; N]#153249Not-Sarthak wants to merge 2 commits intorust-lang:mainfrom
Not-Sarthak wants to merge 2 commits intorust-lang:mainfrom
Conversation
Collaborator
|
r? @joboet rustbot has assigned @joboet. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
The forward direction (Vec<T> == [T; N]) has been stable since 1.0.0, but the reverse ([T; N] == Vec<T>) was missing. This adds the symmetric implementation using the existing __impl_slice_eq1 macro.
c73db1d to
0ba7ddc
Compare
This comment has been minimized.
This comment has been minimized.
The new PartialEq<Vec<U, A>> impl for [T; N] adds one more impl to the suggestion list, changing "and 11 others" to "and 12 others".
Member
|
Duplicate of #149045 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PartialEqimplementation:impl<T, U, A: Allocator, const N: usize> PartialEq<Vec<U, A>> for [T; N]Vec<T> == [T; N]) has been stable since 1.0.0, but[T; N] == Vec<T>was missing__impl_slice_eq1macro, following the same pattern as other reverse impls (e.g.,&[T] == Vec,[T] == Vec)Closes #149017
Test plan
./x test tidy --blesspasses./x test library/allocpasses[1, 2, 3] == vec![1, 2, 3]compiles on nightly