rust-lang / trait-system-refactor-initiative

The Rustc Trait System Refactor Initiative
21 stars 0 forks source link

alias bound candidates for normalizable aliases allows more code to compile #72

Open lcnr opened 11 months ago

lcnr commented 11 months ago

The new solver uses alias bound candidates for aliases which previously were eagerly normalized, causing in the following example to now compile: https://rust.godbolt.org/z/E3e6WqoEb

trait Bound {}

trait Trait {
    type Assoc: Bound; 
}

fn impls_bound<T: Bound>() {}

fn foo<T: Trait<Assoc = U>, U>() {
    impls_bound::<<T as Trait>::Assoc>();
}