1
Fork 0

Add another test

This commit is contained in:
Joshua Nelson 2020-08-08 10:19:56 -04:00
parent b146000e91
commit a306e12874
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,15 @@
// normalize-stderr-test: "`.*`" -> "`DEF_ID`"
// normalize-stdout-test: "`.*`" -> "`DEF_ID`"
// edition:2018
pub async fn f() -> impl std::fmt::Debug {
#[derive(Debug)]
enum E {
//~^ ERROR recursive type `f::{{closure}}#0::E` has infinite size
This(E),
Unit,
}
E::Unit
}
fn main() {}

View file

@ -0,0 +1,17 @@
error[E0072]: recursive type `DEF_ID` has infinite size
--> $DIR/infinite-recursive-type-impl-trait-return.rs:7:5
|
LL | enum E {
| ^^^^^^ recursive type has infinite size
LL |
LL | This(E),
| - recursive without indirection
|
help: insert some indirection (e.g., a `DEF_ID` representable
|
LL | This(Box<E>),
| ^^^^ ^
error: aborting due to previous error
For more information about this error, try `DEF_ID`.