-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
17 changes: 17 additions & 0 deletions
17
src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |