Skip to content

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

Closed
@nikomatsakis

Description

@nikomatsakis

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions