// check-pass // compile-flags: -Znext-solver 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`. // // We end up emitting a delayed obligation, causing this to still // succeed. x = transform(x); x = Inv::(None); }