Skip to content

Commit aa8c147

Browse files
committed
Add regression test
1 parent a6236fa commit aa8c147

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
type Foo<'a> = impl Fn() -> Foo<'a>;
4+
5+
fn crash<'a>(_: &'a (), x: Foo<'a>) -> Foo<'a> {
6+
//~^ ERROR: overflow evaluating the requirement `<Foo<'a> as FnOnce<()>>::Output == Foo<'a>
7+
x
8+
}
9+
10+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0275]: overflow evaluating the requirement `<Foo<'a> as FnOnce<()>>::Output == Foo<'a>`
2+
--> $DIR/self-referential-in-fn-trait.rs:5:40
3+
|
4+
LL | fn crash<'a>(_: &'a (), x: Foo<'a>) -> Foo<'a> {
5+
| ^^^^^^^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0275`.

0 commit comments

Comments
 (0)