You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a [borrow], [dereference][dereference expression], [field][field expression], or [tuple indexing expression] has an extended temporary scope, then so does its operand. If an [indexing expression] has an extended temporary scope, then the indexed expression also has an extended temporary scope.
389
+
A *place base context* is an expression context that is one of the following:
390
+
391
+
- The operand of a [dereference][dereference expression], [field][field expression], or [tuple indexing expression].
392
+
- The indexed expression of an [indexing expression].
393
+
- The operand of a [borrow expression] in a place base context.
394
+
395
+
The *projected expression* of an expression in a place base context is its closest ancestor that is not in a place base context.
396
+
397
+
The temporary scope of an expression in a place base context is defined to be the temporary scope of its projected expression.
The [temporary scope] of the operand of a [borrow] expression is the *borrow scope* of the operand expression, defined below.
488
+
The [temporary scope] of the operand of a [borrow expression] outside of a [place base context][destructors.scope.lifetime-extension.sub-expressions] is the *borrow scope* of the operand expression, defined below.
The borrow scope of an expression is defined in terms of *extending expressions* and their *extending parents*. An extending expression is an expression which is one of the following:
487
495
488
-
* The operand of a [borrow] expression, the extending parent of which is the borrow expression.
496
+
* The operand of a [borrow expression], the extending parent of which is the borrow expression.
489
497
* The [super operands] of a [super macro call] expression, the extending parent of which is the macro call expression.
490
498
* The operand(s) of an [array][array expression], [cast][cast
491
499
expression], [braced struct][struct expression], or [tuple][tuple expression]
@@ -733,7 +741,7 @@ There is one additional case to be aware of: when a panic reaches a [non-unwindi
0 commit comments