Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up== fails to match types on associated type with two PartialEq<A / B> bounds #34792
Comments
eddyb
added
A-typesystem
I-nominated
A-associated-items
T-compiler
labels
Jul 12, 2016
This comment has been minimized.
This comment has been minimized.
|
cf. #24066 |
This comment has been minimized.
This comment has been minimized.
|
Looks like this is caused by using |
This comment has been minimized.
This comment has been minimized.
rozbb
commented
Jul 18, 2016
|
Update: using filter and then calling |
This comment has been minimized.
This comment has been minimized.
|
@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
}
}, |
This comment has been minimized.
This comment has been minimized.
|
I guess that you didn't just call |
rozbb
pushed a commit
to rozbb/rust
that referenced
this issue
Jul 19, 2016
rozbb
pushed a commit
to rozbb/rust
that referenced
this issue
Jul 20, 2016
This comment has been minimized.
This comment has been minimized.
|
Related: #34912 |
This comment has been minimized.
This comment has been minimized.
|
triage: P-medium |
SimonSapin commentedJul 12, 2016
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 compareTwith itself as well as another type.