Skip to content

Commit 1b44947

Browse files
committed
Update await desugaring after rust-lang#64292
Signed-off-by: David Wood <david@davidtw.co>
1 parent dce794c commit 1b44947

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/expressions/await-expr.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ Effectively, an `<expr>.await` expression is roughly
5252
equivalent to the following (this desugaring is not normative):
5353

5454
```rust,ignore
55-
let future = /* <expr> */;
56-
loop {
57-
let mut pin = unsafe { Pin::new_unchecked(&mut future) };
58-
match Pin::future::poll(Pin::borrow(&mut pin), &mut current_context) {
59-
Poll::Ready(r) => break r,
60-
Poll::Pending => yield Poll::Pending,
55+
match /* <expr> */ {
56+
mut pinned => loop {
57+
let mut pin = unsafe { Pin::new_unchecked(&mut pinned) };
58+
match Pin::future::poll(Pin::borrow(&mut pin), &mut current_context) {
59+
Poll::Ready(r) => break r,
60+
Poll::Pending => yield Poll::Pending,
61+
}
6162
}
6263
}
6364
```

0 commit comments

Comments
 (0)