-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The following Rust source (playground):
#![feature(async_await)]
async fn foo(n: usize) {
if n > 0 {
foo(n - 1).await;
}
}
fn main() {
}
gives the error:
error[E0720]: opaque type expands to a recursive type
--> src/main.rs:3:24
|
3 | async fn foo(n: usize) {
| ^ expands to self-referential type
|
= note: expanded type is `std::future::GenFuture<[static generator@src/main.rs:3:24: 7:2 n:usize {usize, bool, impl std::future::Future, ()}]>`
We could be a lot clearer.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.