-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up E0733 explanation #74781
Clean up E0733 explanation #74781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general note - this explains how to fix the error, but not why it's an error in the first place. Do you know why? It's not obvious to me.
@@ -1,4 +1,6 @@ | |||
Recursion in an `async fn` requires boxing. For example, this will not compile: | |||
An `async` function used recursion without boxing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An `async` function used recursion without boxing. | |
An [`async`] function used recursion without boxing. | |
[`async`]: https://doc.rust-lang.org/std/keyword.async.html |
@@ -8,8 +10,8 @@ async fn foo(n: usize) { | |||
} | |||
``` | |||
|
|||
To achieve async recursion, the `async fn` needs to be desugared | |||
such that the `Future` is explicit in the return type: | |||
To achieve async recursion, the `async fn` needs to be desugared such that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To achieve async recursion, the `async fn` needs to be desugared such that the | |
To perform async recursion, the `async fn` needs to be desugared such that the |
@jyn514 I assume that it's because of the stack but honestly, I'm not really sure. |
f0b7ed3
to
507f403
Compare
@bors r+ rollup=always 🤷 mysteries of |
📌 Commit 507f403 has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#74686 (BTreeMap: remove into_slices and its unsafe block) - rust-lang#74762 (BTreeMap::drain_filter should not touch the root during iteration) - rust-lang#74781 (Clean up E0733 explanation) - rust-lang#74874 (BTreeMap: define forget_type only when relevant) - rust-lang#74974 (Make tests faster in Miri) - rust-lang#75010 (Update elasticlunr-rs and ammonia transitive deps) - rust-lang#75041 (Replaced log with tracing crate) - rust-lang#75044 (Clean up E0744 explanation) - rust-lang#75054 (Rename rustc_middle::cstore::DepKind to CrateDepKind) - rust-lang#75057 (Avoid dumping rustc invocations to stdout) Failed merges: - rust-lang#74827 (Move bulk of BTreeMap::insert method down to new method on handle) r? @ghost
r? @Dylan-DPC