Skip to content
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

Eliminate assoc type projection predicate candidate duplicates #22055

Closed
wants to merge 1 commit into from

Conversation

edwardw
Copy link
Contributor

@edwardw edwardw commented Feb 7, 2015

When projecting associate types for a trait's default methods, the
trait itself was added to the predicate candidate list twice: one from
parameter environment, the other from trait definition. Then the
duplicates were deemed as code ambiguity and the compiler rejected the
code. Simply checking and dropping the duplicates solves the issue.

Closes #22036

@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

r? @nikomatsakis or @nick29581

When projecting associate types for a trait's default methods, the
trait itself was added to the predicate candidate list twice: one from
parameter environment, the other from trait definition. Then the
duplicates were deemed as code ambiguity and the compiler rejected the
code. Simply checking and dropping the duplicates solves the issue.

Closes rust-lang#22036
@nikomatsakis
Copy link
Contributor

@edwardw nice, but I think this was basically a dup of #21968

@nikomatsakis
Copy link
Contributor

that is, it has the same effect (and fixes the same issue).

@nikomatsakis
Copy link
Contributor

(So I'm going to close the PR.)

@nikomatsakis
Copy link
Contributor

And I'm not sure why I left that in 3 distinct comments, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't write default methods that depend on a bound of an associated type of their traits
5 participants