use std::marker::PhantomData; fn _alias_check() { WrongImpl::foo(0i32); //~^ ERROR the trait bound `RawImpl<_>: Raw<_>` is not satisfied WrongImpl::<()>::foo(0i32); //~^ ERROR the trait bound `RawImpl<()>: Raw<()>` is not satisfied //~| ERROR trait bounds were not satisfied 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() {}