-
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
Allow comparing Vec
s with different allocators using ==
#93755
Allow comparing Vec
s with different allocators using ==
#93755
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@rust-lang/libs-api: Before:impl<T, U, A> PartialEq<Vec<U, A>> for Vec<T, A>
where
T: PartialEq<U>,
A: Allocator; After:impl<T, U, A1, A2> PartialEq<Vec<U, A2>> for Vec<T, A1>
where
T: PartialEq<U>,
A1: Allocator,
A2: Allocator; |
Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
We should watch for any issues with this in the beta crater runs. I don't anticipate an issue either. |
@bors r+ |
📌 Commit ee23fd2 has been approved by |
…s-with-different-allocators, r=dtolnay Allow comparing `Vec`s with different allocators using `==` See https://stackoverflow.com/q/71021633/7884305. I did not changed the `PartialOrd` impl too because it was not generic already (didn't support `Vec<T> <=> Vec<U> where T: PartialOrd<U>`). Does it needs tests? I don't think this will hurt type inference much because the default allocator is usually not inferred (`new()` specifies it directly, and even with other allocators, you pass the allocator to `new_in()` so the compiler usually knows the type). I think this requires FCP since the impls are already stable.
Rollup of 4 pull requests Successful merges: - rust-lang#88375 (Clarify that ManuallyDrop<T> has same layout as T) - rust-lang#93755 (Allow comparing `Vec`s with different allocators using `==`) - rust-lang#95016 (Docs: make Vec::from_raw_parts documentation less strict) - rust-lang#95098 (impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
See https://stackoverflow.com/q/71021633/7884305.
I did not changed the
PartialOrd
impl too because it was not generic already (didn't supportVec<T> <=> Vec<U> where T: PartialOrd<U>
).Does it needs tests?
I don't think this will hurt type inference much because the default allocator is usually not inferred (
new()
specifies it directly, and even with other allocators, you pass the allocator tonew_in()
so the compiler usually knows the type).I think this requires FCP since the impls are already stable.