-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Overly specific PartialEq impl for Option and Result #76483
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
Comments
I just tried it for
The left is
It doesn't know what kind of So, I think this is an infeasible change. |
Reached this as well and found the same problem with Result; not even the standard library compiles because of the same inference failure that @cuviper reports above.
|
Duplicate of #20063 (and several more exact duplicates and similar cases which have been closed as duplicate of that isue). |
I tried this code:
(playground)
This is because
PartialEq
impls are#[derive]
d forOption
andResult
, which gives them conservative bounds.Instead of current
I'd expect
and likewise, for
Result
Note that this is similar to what
Vec<T>
already implements:Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: