-
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
== fails to match types on associated type with two PartialEq<A / B> bounds #34792
Comments
cf. #24066 |
Looks like this is caused by using cc @rust-lang/compiler |
Update: using filter and then calling |
@doomrobo I believe your problem is this logic. However, it's incorrect with your changes as // Arbitrarily give param candidates priority
// over projection and object candidates.
ObjectCandidate => true,
ProjectionCandidate(_) => {
if let ProjectionCandidate(_) = other.candidate {
false
} else {
true
}
}, |
I guess that you didn't just call |
Related: #34912 |
triage: P-medium |
Triage: no change:
|
This is fixed on current master. Should be closed. |
@estebank I would like to work on this issue if its still relevant? |
As @ldm0 mentioned the original code now compiles: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=106d275bc9d5ae878cc0c28c038dcec7 Closing as there doesn’t seem to be anything left to do here. |
@SimonSapin do we have any |
Oh good point. Sorry I missed the label. @humancalico Yes, feel free to work on adding a regression test! |
@rustbot claim |
…imulacrum Add test for rust-lang#34792 Closes rust-lang#34792
Rollup of 17 pull requests Successful merges: - rust-lang#78455 (Introduce {Ref, RefMut}::try_map for optional projections in RefCell) - rust-lang#80144 (Remove giant badge in README) - rust-lang#80614 (Explain why borrows can't be held across yield point in async blocks) - rust-lang#80670 (TrustedRandomAaccess specialization composes incorrectly for nested iter::Zips) - rust-lang#80681 (Clarify what the effects of a 'logic error' are) - rust-lang#80764 (Re-stabilize Weak::as_ptr and friends for unsized T) - rust-lang#80901 (Make `x.py --color always` apply to logging too) - rust-lang#80902 (Add a regression test for rust-lang#76281) - rust-lang#80941 (Do not suggest invalid code in pattern with loop) - rust-lang#80968 (Stabilize the poll_map feature) - rust-lang#80971 (Put all feature gate tests under `feature-gates/`) - rust-lang#81021 (Remove doctree::Import) - rust-lang#81040 (doctest: Reset errors before dropping the parse session) - rust-lang#81060 (Add a regression test for rust-lang#50041) - rust-lang#81065 (codegen_cranelift: Fix redundant semicolon warn) - rust-lang#81069 (Add sample code for Rc::new_cyclic) - rust-lang#81081 (Add test for rust-lang#34792) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
rustc 1.12.0-nightly (47b3a98 2016-07-10)
Changing the order of bounds in the associated type declaration changes which
==
causes a spurious "mismatched types" error.Using UFCS works around the issue:
The same issue exists with bounds like
type T: PartialEq + PartialEq<B>
to compareT
with itself as well as another type.The text was updated successfully, but these errors were encountered: