use std::marker::PhantomData; fn a() { WrongImpl::foo(0i32); //~^ ERROR the function or associated item `foo` exists for struct `SafeImpl<_, RawImpl<_>>`, but its trait bounds were not satisfied //~| ERROR the trait bound `RawImpl<_>: Raw<_>` is not satisfied } fn b() { WrongImpl::<()>::foo(0i32); //~^ ERROR the trait bound `RawImpl<()>: Raw<()>` is not satisfied //~| ERROR trait bounds were not satisfied } fn c() { CorrectImpl::foo(0i32); } pub trait Raw { type Value; } pub type WrongImpl = SafeImpl>; pub type CorrectImpl = SafeImpl<[T], RawImpl>; pub struct RawImpl(PhantomData); impl Raw<[T]> for RawImpl { type Value = T; } pub struct SafeImpl>(PhantomData<(A, T)>); impl> SafeImpl { pub fn foo(value: A::Value) {} } fn main() {}