#![feature(impl_trait_in_assoc_type)] trait Foo { type Bar; fn foo(&self) -> >::Bar where Self: Foo<()>; } impl Foo<()> for () { type Bar = impl std::fmt::Debug; fn foo(&self) -> Self::Bar {} } impl Foo for () { type Bar = u32; fn foo(&self) -> >::Bar {} //~^ ERROR: mismatched types } fn main() {}