File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,10 +89,12 @@ rvalue expression to a `'static` slot occurs when the expression could be
8989written in a constant, borrowed, and dereferencing that borrow where the
9090expression was the originally written, without changing the runtime behavior.
9191That is, the promoted expression can be evaluated at compile-time and the
92- resulting value does not contain interior mutability or destructors.
92+ resulting value does not contain interior mutability or destructors (these
93+ properties are determined based on the value where possible, e.g. ` &None `
94+ always has the type ` &'static Option<_> ` , as it contains nothing disallowed).
9395Otherwise, lifetime of temporary values is typically the innermost enclosing
9496statement; the tail expression of a block is considered part of the statement
95- that encloses the block
97+ that encloses the block.
9698
9799When a temporary rvalue is being created that is assigned into a ` let `
98100declaration, however, the temporary is created with the lifetime of the
You can’t perform that action at this time.
0 commit comments