Skip to content

Commit

Permalink
More precise wording around temporaries
Browse files Browse the repository at this point in the history
  • Loading branch information
eholk committed Sep 29, 2021
1 parent 89a6f57 commit c91c126
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/expressions/block-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ Here the resulting future will be `Send` if `Bar` is send, since `x` is defined

Note that for values of types that implement `Drop`, there is an implicit use of the value at the end of its lifetime in order to run the destructor.

Besides named variables, temporary values also count. For example in `foo(&bar, baz.await)`, the value `&bar` is considered live across the `await` point. This is also true of the scrutinee of the match expression, since [the scrutinee is live for the entire match block][temporary-scopes].
Besides named variables, temporary values also affect auto trait inference.
For example in `foo(&bar, baz.await)`, the value `&bar` is considered live across the `await` point.
This is also true of the scrutinee of the match expression, since [the scrutinee is live for the entire match block][temporary-scopes].

## `unsafe` blocks

Expand Down

0 comments on commit c91c126

Please sign in to comment.