Skip to content

Eliminate assoc type projection predicate candidate duplicates #22185

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

Merged
merged 1 commit into from
Feb 12, 2015

Conversation

edwardw
Copy link
Contributor

@edwardw edwardw commented Feb 11, 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

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
@rust-highfive
Copy link
Contributor

r? @huonw

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

@edwardw
Copy link
Contributor Author

edwardw commented Feb 11, 2015

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned huonw Feb 11, 2015
@nikomatsakis
Copy link
Contributor

@bors r+ 2af968e

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 11, 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 rust-lang#22036
@bors
Copy link
Collaborator

bors commented Feb 11, 2015

⌛ Testing commit 2af968e with merge e9f8329...

@bors
Copy link
Collaborator

bors commented Feb 11, 2015

💔 Test failed - auto-linux-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

@bors bors merged commit 2af968e into rust-lang:master Feb 12, 2015
@edwardw edwardw deleted the default-methods branch February 12, 2015 05:23
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
6 participants