Skip to content

Commit 210f456

Browse files
nikomatsakisehuss
authored andcommitted
note that async-await is only available in rust2018
1 parent e356f63 commit 210f456

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/expressions/await-expr.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ More specifically, an `<expr>.await` expression has the following effect.
2929
[`Poll::Pending`]: https://doc.rust-lang.org/std/task/enum.Poll.html#variant.Pending
3030
[`Poll::Ready`]: https://doc.rust-lang.org/std/task/enum.Poll.html#variant.Ready
3131

32+
> **Edition differences**: Await expressions are only available in Rust 2018.
33+
3234
## Task context
3335

3436
The task context refers to the [`Context`] which was supplied to the

src/expressions/block-expr.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ this type is unspecified, but it is roughly equivalent to an enum with
9999
one variant per `await` point, where each variant stores the data
100100
needed to resume from its corresponding point.
101101

102+
> **Edition differences**: Async blocks are only available in Rust 2018.
103+
102104
### Capture modes
103105

104106
Async blocks capture variables from their environment using the same
@@ -133,7 +135,7 @@ of the future.
133135
Finally, the `break` and `continue` keywords cannot be used to branch
134136
out from an async block. Therefore the following is illegal:
135137

136-
```rust,compile_fail
138+
```rust,edition2018,compile_fail
137139
loop {
138140
async move {
139141
break; // This would break out of the loop.

src/items/functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ For more information on the effect of async, see [`async` blocks][`async` block]
236236
[`async move` block]: ../expressions/block-expr.html#async-blocks
237237
[`impl Future`]: ../types/impl-trait.html
238238

239+
> **Edition differences**: Async functions are only available in Rust 2018.
240+
239241
## Attributes on functions
240242

241243
[Outer attributes][attributes] are allowed on functions. [Inner

0 commit comments

Comments
 (0)