// compile-flags: -Ztrait-solver=next trait Test { type Assoc; } fn transform(x: Inv) -> Inv { todo!() } impl Test for i32 { type Assoc = i32; } impl Test for String { type Assoc = String; } struct Inv(Option<*mut T>); fn main() { let mut x: Inv<_> = Inv(None); // This ends up equating `Inv` with `Inv<::Assoc>` // which fails the occurs check when generalizing `?x`. x = transform(x); //~^ ERROR mismatched types x = Inv::(None); }