trait Trait {
type Assoc: Clone;
}
fn is_clone<T: Clone>(_: *mut T) {}
fn foo<T: Trait<Assoc = U>, U>(x: *mut <T as Trait>::Assoc) {
is_clone(x);
}
https://rust.godbolt.org/z/4WojT7KTW
This currently results in an ICE:
- in HIR typeck
<T as Trait>::Assoc: Clone holds due to the alias bound candidate
- during writeback we deeply normalize, replacing
<T as Trait>::Assoc with U
- MIR typeck checks
U: Clone which does not hold, resulting in an ICE