File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed 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
89
89
written in a constant, borrowed, and dereferencing that borrow where the
90
90
expression was the originally written, without changing the runtime behavior.
91
91
That 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).
93
95
Otherwise, lifetime of temporary values is typically the innermost enclosing
94
96
statement; the tail expression of a block is considered part of the statement
95
- that encloses the block
97
+ that encloses the block.
96
98
97
99
When a temporary rvalue is being created that is assigned into a ` let `
98
100
declaration, however, the temporary is created with the lifetime of the
You can’t perform that action at this time.
0 commit comments