Skip to content

Commit a306e12

Browse files
committed
Add another test
1 parent b146000 commit a306e12

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// normalize-stderr-test: "`.*`" -> "`DEF_ID`"
2+
// normalize-stdout-test: "`.*`" -> "`DEF_ID`"
3+
// edition:2018
4+
5+
pub async fn f() -> impl std::fmt::Debug {
6+
#[derive(Debug)]
7+
enum E {
8+
//~^ ERROR recursive type `f::{{closure}}#0::E` has infinite size
9+
This(E),
10+
Unit,
11+
}
12+
E::Unit
13+
}
14+
15+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0072]: recursive type `DEF_ID` has infinite size
2+
--> $DIR/infinite-recursive-type-impl-trait-return.rs:7:5
3+
|
4+
LL | enum E {
5+
| ^^^^^^ recursive type has infinite size
6+
LL |
7+
LL | This(E),
8+
| - recursive without indirection
9+
|
10+
help: insert some indirection (e.g., a `DEF_ID` representable
11+
|
12+
LL | This(Box<E>),
13+
| ^^^^ ^
14+
15+
error: aborting due to previous error
16+
17+
For more information about this error, try `DEF_ID`.

0 commit comments

Comments
 (0)