mirror of https://github.com/rust-lang/rust
22 lines
367 B
Rust
22 lines
367 B
Rust
#![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 {
|
|
//~^ ERROR: type annotations needed
|
|
|_| ()
|
|
}
|
|
|
|
fn main() {}
|