Open
Description
// passes with old impl, ambiguous with the new one.
#![feature(type_alias_impl_trait)]
trait Trait {
type Assoc;
}
impl<T: Copy> Trait for T {
type Assoc = T;
}
fn needs_trait<T: Trait<Assoc = U>, U>() {}
type Tait = impl Copy;
fn define() -> Tait {}
fn check() {
needs_trait::<Tait, Tait>();
//[new]~^ ERROR type annotations needed
//[new]~| NOTE cannot satisfy `<Tait as Trait>::Assoc == Tait`
}
fn main() {}
there are two candidates to prove <Tait as Trait>::Assoc = Tait
:
- impl candidate
- ambig self infer type from trying to define the opaque
because it's a projection goal, we try to constrain the inference variable of the term, so we're unable to make progress and end up with ambiguity.
Metadata
Metadata
Assignees
Labels
No labels