]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-74244.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / issue-74244.rs
1 #![feature(type_alias_impl_trait)]
2
3 trait Allocator {
4     type Buffer;
5 }
6
7 struct DefaultAllocator;
8
9 impl<T> Allocator for DefaultAllocator {
10     //~^ ERROR: the type parameter `T` is not constrained
11     type Buffer = ();
12 }
13
14 type A = impl Fn(<DefaultAllocator as Allocator>::Buffer);
15
16 fn foo() -> A {
17     |_| ()
18 }
19
20 fn main() {}