diff options
Diffstat (limited to 'tests/ui/type-alias-impl-trait/issue-74244.rs')
-rw-r--r-- | tests/ui/type-alias-impl-trait/issue-74244.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/issue-74244.rs b/tests/ui/type-alias-impl-trait/issue-74244.rs new file mode 100644 index 000000000..bb4104b3d --- /dev/null +++ b/tests/ui/type-alias-impl-trait/issue-74244.rs @@ -0,0 +1,20 @@ +#![feature(type_alias_impl_trait)] + +trait Allocator { + type Buffer; +} + +struct DefaultAllocator; + +impl<T> Allocator for DefaultAllocator { + //~^ ERROR: the type parameter `T` is not constrained + type Buffer = (); +} + +type A = impl Fn(<DefaultAllocator as Allocator>::Buffer); + +fn foo() -> A { + |_| () +} + +fn main() {} |