Make async closures directly lower to ClosureKind::CoroutineClosure
This commit is contained in:
parent
b2bb51734c
commit
a20421734b
12 changed files with 93 additions and 88 deletions
|
@ -952,6 +952,11 @@ pub enum ClosureKind {
|
|||
/// usage (e.g. `let x = || { yield (); }`) or from a desugared expression
|
||||
/// (e.g. `async` and `gen` blocks).
|
||||
Coroutine(CoroutineKind),
|
||||
/// This is a coroutine-closure, which is a special sugared closure that
|
||||
/// returns one of the sugared coroutine (`async`/`gen`/`async gen`). It
|
||||
/// additionally allows capturing the coroutine's upvars by ref, and therefore
|
||||
/// needs to be specially treated during analysis and borrowck.
|
||||
CoroutineClosure(CoroutineDesugaring),
|
||||
}
|
||||
|
||||
/// A block of statements `{ .. }`, which may have a label (in this case the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue