-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better recursive async fn error message.
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
- Loading branch information
Showing
3 changed files
with
78 additions
and
16 deletions.
There are no files selected for viewing
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
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
8 changes: 4 additions & 4 deletions
8
src/test/ui/async-await/recursive-async-impl-trait-type.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
error[E0720]: opaque type expands to a recursive type | ||
error[E0733]: recursion in an `async fn` requires boxing | ||
--> $DIR/recursive-async-impl-trait-type.rs:7:40 | ||
| | ||
LL | async fn recursive_async_function() -> () { | ||
| ^^ expands to a recursive type | ||
| ^^ an `async fn` cannot invoke itself directly | ||
| | ||
= note: expanded type is `std::future::GenFuture<[static generator@$DIR/recursive-async-impl-trait-type.rs:7:43: 9:2 {impl std::future::Future, ()}]>` | ||
= note: a recursive `async fn` must be rewritten to return a boxed future. | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0720`. | ||
For more information about this error, try `rustc --explain E0733`. |