Closed
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.