Closed
Description
trait Trait {
type Assoc;
}
fn call<T: Trait>(_: <T as Trait>::Assoc, _: T) { }
fn foo<T: Trait>(rigid: <T as Trait>::Assoc, t: T) {
call::<_ /* ?0 */>(rigid, t);
//~^ ERROR: type mismatch resolving `<T as Trait>::Assoc normalizes-to <T as Trait>::Assoc`
//
// Checking the first argument of `call` will cause us to
// try to coerce `<?0 as Trait>::Assoc` and `<T as Trait>::Assoc`.
// The left hand side is eagerly structurally normalized to
// `?1`, then we add `<?0 as Trait>::Assoc normalizes-to ?1`,
// which fails.
}
Given some <?0 as Trait>::Assoc
, structural normalize currently checks if the predicate <?0 as Trait>::Assoc normalizes-to ?1
may hold. This is ambiguous, but fails later if ?0
is constrained to some T
where T: Trait
, because <T as Trait>::Assoc
is now rigid.
Metadata
Metadata
Assignees
Labels
No labels