trait T { type A; fn foo(&self) -> Self::A { panic!() } } struct S(std::marker::PhantomData); impl T for S { type A = X; } fn main() { S(std::marker::PhantomData).foo(); //~ ERROR type annotations needed }