Skip to content

Commit efe16bf

Browse files
committed
Add some missing rules
1 parent 853ccb4 commit efe16bf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/expressions/closure-expr.md

+4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ Which traits the closure type implement depends on how variables are captured, t
5454
See the [call traits and coercions] chapter for how and when a closure implements `Fn`, `FnMut`, and `FnOnce`.
5555
The closure type implements [`Send`] and [`Sync`] if the type of every captured variable also implements the trait.
5656

57+
r[expr.closure.async]
5758
## Async closures
5859

60+
r[expr.closure.async.intro]
5961
Closures marked with the `async` keyword indicate that they are asynchronous in an analogous way to an [async function][items.fn.async].
6062

63+
r[expr.closure.async.future]
6164
Calling the async closure does not perform any work, but instead evaluates to a value that implements [`Future`] that corresponds to the computation of the body of the closure.
6265

6366
```rust
@@ -74,6 +77,7 @@ async fn example() {
7477
}
7578
```
7679

80+
r[expr.closure.async.edition2018]
7781
> **Edition differences**: Async closures are only available beginning with Rust 2018.
7882
7983
## Example

0 commit comments

Comments
 (0)