Skip to content

normalization does not use impls covered by param env candidates #12

Closed
@lcnr

Description

@lcnr

the old solver does not consider impl candidates for normalization if there is also a candidate from the environment:

trait Trait {
    type Assoc;
}

impl<T> Trait for T {
    type Assoc = T;
}

fn foo<T: Trait>(x: T) -> <T as Trait>::Assoc {
    x // ERROR
}

godbolt

This will presumably break if we instead normalize projections for environment trait bounds to "rigid projections" because there will now be ambiguity again. This is concerning as "rigid projections" are considered as one of the longterm solutions for #1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions