#![feature(type_alias_impl_trait)] trait Allocator { type Buffer; } struct DefaultAllocator; impl Allocator for DefaultAllocator { //~^ ERROR: the type parameter `T` is not constrained type Buffer = (); } type A = impl Fn(::Buffer); fn foo() -> A { |_| () } fn main() {}