Skip to content

Commit

Permalink
Async clarifications from compiler-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Dec 12, 2024
1 parent 5a8b949 commit 8eb71da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types/closure.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ r[type.closure.call.fn]
r[type.closure.non-capturing]
*Non-capturing closures* are closures that don't capture anything from their
environment. Non-async closures can be coerced to function pointers (e.g., `fn()`)
environment. Non-async, non-capturing closures can be coerced to function pointers (e.g., `fn()`)
with the matching signature.

```rust
Expand All @@ -521,7 +521,7 @@ The [`Future`] returned by the async closure has similar capturing characteristi
- The `Future` includes a mutable capture.
- The async closure captures by value, except when the value is accessed with a dereference projection.

If the async closure is lending to its `Future`, then [`FnMut`] and [`Fn`] are *not* implemented.
If the async closure is lending to its `Future`, then [`FnMut`] and [`Fn`] are *not* implemented. [`FnOnce`] is always implemented.

> **Example**: The first clause for a mutable capture can be illustrated with the following:
>
Expand Down

0 comments on commit 8eb71da

Please sign in to comment.