Skip to content

Commit

Permalink
Add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Aug 8, 2020
1 parent b146000 commit a306e12
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit a306e12

Please sign in to comment.