55>   ;  ; [ _ Expression_ ] ` . ` ` await `
66
77Await expressions are legal only within ` async ` contexts, like an
8- ` async fn ` or an ` async ` block. They operate on a future. Their effect
8+ [ ` async fn ` ] or an [ ` async ` block] . They operate on a [ future] . Their effect
99is to suspend the current computation until the given future is ready
1010to produce a value.
1111
1212More specifically, an ` <expr>.await ` expression has the following effect.
1313
14141 . Evaluate ` <expr> ` to a [ future] ` tmp ` ;
15- 2 . Pin ` tmp ` using ` Pin::new_unchecked ` ;
15+ 2 . Pin ` tmp ` using [ ` Pin::new_unchecked ` ] ;
16163 . This pinned future is then polled by calling the [ ` Future::poll ` ] method and
17- passing it the current task context (see below );
17+ passing it the current [ task context] ( #task-context ) ;
18183 . If the call to ` poll ` returns [ ` Poll::Pending ` ] , then the future
1919 returns ` Poll::Pending ` , suspending its state so that, when the
2020 surrounding async context is re-polled, execution returns to step
@@ -23,10 +23,13 @@ More specifically, an `<expr>.await` expression has the following effect.
2323 value contained in the [ ` Poll::Ready ` ] variant is used as the result
2424 of the ` await ` expression itself.
2525
26+ [ `async fn` ] : ../items/functions.md#async-functions
27+ [ `async` block ] : block-expr.md#async-blocks
2628[ future ] : ../../std/future/trait.Future.html
2729[ _Expression_ ] : ../expressions.md
2830[ `Future::poll` ] : ../../std/future/trait.Future.html#tymethod.poll
2931[ `Context` ] : ../../std/task/struct.Context.html
32+ [ `Pin::new_unchecked` ] : ../../std/pin/struct.Pin.html#method.new_unchecked
3033[ `Poll::Pending` ] : ../../std/task/enum.Poll.html#variant.Pending
3134[ `Poll::Ready` ] : ../../std/task/enum.Poll.html#variant.Ready
3235
0 commit comments