Skip to content

Commit 73b8f55

Browse files
committed
apply havvy nits
1 parent 09ca63a commit 73b8f55

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/expressions/await-expr.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ to produce a value.
1111

1212
More specifically, an `<expr>.await` expression has the following effect.
1313

14-
1. Evaluate `<expr>` to a future `tmp`;
14+
1. Evaluate `<expr>` to a [future] `tmp`;
1515
2. Pin `tmp` using `Pin::new_unchecked`;
1616
3. This pinned future is then polled by calling the [`Future::poll`] method and
1717
passing it the current task context (see below);
@@ -23,6 +23,7 @@ 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+
[future]: https://doc.rust-lang.org/std/future/trait.Future.html
2627
[_Expression_]: expressions.html
2728
[`Future::poll`]: https://doc.rust-lang.org/std/future/trait.Future.html#tymethod.poll
2829
[`Context`]: https://doc.rust-lang.org/std/task/struct.Context.html
@@ -34,9 +35,9 @@ More specifically, an `<expr>.await` expression has the following effect.
3435
## Task context
3536

3637
The task context refers to the [`Context`] which was supplied to the
37-
current [async context] when it itself was polled. Because `await`
38-
expressions are only legal in an async context, there must be some
39-
task context available.
38+
current [async context] when the async context itself was
39+
polled. Because `await` expressions are only legal in an async
40+
context, there must be some task context available.
4041

4142
[`Context`]: https://doc.rust-lang.org/std/task/struct.Context.html
4243
[async context]: ../expressions/block-expr.html#async-context

src/expressions/block-expr.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ its immediate effect is to produce and return an anonymous type.
9595
Whereas closures return a type that implements one or more of the
9696
`std::ops::Fn` traits, however, the type returned for an async block
9797
implements the `std::future::Future` trait. The actual data format for
98-
this type is unspecified, but it is roughly equivalent to an enum with
99-
one variant per `await` point, where each variant stores the data
100-
needed to resume from its corresponding point.
98+
this type is unspecified.
99+
100+
> **Note:** The future type that rustc generates is roughly equivalent
101+
> to an enum with one variant per `await` point, where each variant
102+
> stores the data needed to resume from its corresponding point.
101103
102104
> **Edition differences**: Async blocks are only available in Rust 2018.
103105

0 commit comments

Comments
 (0)