-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
VecDeque<T> should implement PartialEq with &[T] #38625
Comments
I'm working on this. |
I ran into an issue. rust/src/libcollections/vec_deque.rs Lines 2530 to 2531 in a9ab778
These now become errors:
|
Is this inference issue allowed breakage? |
It's definitely allowed, but not every allowed type inference breakage is a good idea. So it still has to be decided carefully. |
@frewsxcv Mind posting a PR? Perhaps we can find a way to fix the inference breakage. |
Opened a PR: #38661. |
I think that inference failure was there long before Rust 1.0 |
It occurs because prior to this PR, the only thing you could compare |
Implement `PartialEq<[A]>` for `VecDeque<A>`. Fixes #38625.
Implement `PartialEq<[A]>` for `VecDeque<A>`. Fixes #38625.
I believe this is definitely possible (comparing the iterators of each), and I suspect that there's a more efficient method as well.
See this documentation PR where it simplifies the code: https://github.com/rust-lang/rust/pull/38581/files#diff-266e22074e3b36596081857cbf5b1513R1256.
The text was updated successfully, but these errors were encountered: