Skip to content

Commit

Permalink
Fix nits.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb authored Aug 16, 2017
1 parent 994bfa5 commit ef04c90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ rvalue expression to a `'static` slot occurs when the expression could be
written in a constant, borrowed, and dereferencing that borrow where the
expression was the originally written, without changing the runtime behavior.
That is, the promoted expression can be evaluated at compile-time and the
resulting value does not contain interior mutability or destructors.
resulting value does not contain interior mutability or destructors (these
properties are determined based on the value where possible, e.g. `&None`
always has the type `&'static Option<_>`, as it contains nothing disallowed).
Otherwise, lifetime of temporary values is typically the innermost enclosing
statement; the tail expression of a block is considered part of the statement
that encloses the block
that encloses the block.

When a temporary rvalue is being created that is assigned into a `let`
declaration, however, the temporary is created with the lifetime of the
Expand Down

0 comments on commit ef04c90

Please sign in to comment.