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

False ambiguity report between builtin bound expansion and where clauses #20959

Closed
nikomatsakis opened this issue Jan 11, 2015 · 0 comments
Closed
Assignees
Labels
A-traits Area: Trait system

Comments

@nikomatsakis
Copy link
Contributor

The following program:

fn foo<K>(x: Option<K>)
    where Option<K> : Sized
{
    let y = x;
}

fn main() { }

dies with a false ambiguity report. The problem is that the builtin bound rules kick and identify that Option<K>: Sized if K: Sized, but there is also a where-clause for that same thing. We should treat builtin-bounds expansions in the same was an explicit impl and resolve in favor of the where-clause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system
Projects
None yet
Development

No branches or pull requests

1 participant