Skip to content

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