1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
// compile-flags: -Ztrait-solver=next // known-bug: unknown trait Test { type Assoc; } fn transform<T: Test>(x: T) -> T::Assoc { todo!() } impl Test for i32 { type Assoc = i32; } impl Test for String { type Assoc = String; } fn main() { let mut x = Default::default(); x = transform(x); x = 1i32; }