1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
trait Tr { type Assoc; } struct W<T>(T); impl Tr for W<i32> { type Assoc = u32; } impl Tr for W<u32> { type Assoc = i32; } fn needs_unit<T: Tr<Assoc = ()>>() {} fn main() { needs_unit::<W<i32>>(); //~^ ERROR type mismatch resolving `<W<i32> as Tr>::Assoc == ()` }