Skip to content

Commit d4fdf6e

Browse files
committed
Add a regression test for issue-74244
1 parent 50ffd6b commit d4fdf6e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
2+
--> $DIR/issue-74244.rs:9:6
3+
|
4+
LL | impl<T> Allocator for DefaultAllocator {
5+
| ^ unconstrained type parameter
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0207`.

0 commit comments

Comments
 (0)