Skip to content

Commit

Permalink
Add a regression test for issue-74244
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Oct 1, 2020
1 parent 50ffd6b commit d4fdf6e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/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() {}
9 changes: 9 additions & 0 deletions src/test/ui/type-alias-impl-trait/issue-74244.stderr
@@ -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`.

0 comments on commit d4fdf6e

Please sign in to comment.