Add a regression test for issue-74244

This commit is contained in:
Yuki Okushi 2020-10-01 14:10:44 +09:00
parent 50ffd6b7cb
commit d4fdf6e754
2 changed files with 29 additions and 0 deletions

View file

@ -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() {}

View file

@ -0,0 +1,9 @@
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-74244.rs:9:6
|
LL | impl<T> Allocator for DefaultAllocator {
| ^ unconstrained type parameter
error: aborting due to previous error
For more information about this error, try `rustc --explain E0207`.