@@ -434,6 +434,7 @@ expression which is one of the following:
434
434
expression] , [ braced struct] [ struct expression ] , or [ tuple] [ tuple expression ]
435
435
expression.
436
436
* The arguments to an extending [ tuple struct] or [ tuple variant] constructor expression.
437
+ * The argument(s) to an extending [ ` pin! ` ] or [ ` format_args! ` ] [ macro invocation] expression.
437
438
* The final expression of any extending [ block expression] .
438
439
439
440
So the borrow expressions in ` &mut 0 ` , ` (&1, &mut 2) ` , and ` Some(&mut 3) `
@@ -447,6 +448,7 @@ extended.
447
448
Here are some examples where expressions have extended temporary scopes:
448
449
449
450
``` rust
451
+ # use std :: pin :: pin;
450
452
# fn temp () {}
451
453
// The temporary that stores the result of `temp()` lives in the same scope
452
454
// as x in these cases.
@@ -456,6 +458,8 @@ let x = &temp() as &dyn Send;
456
458
# x ;
457
459
let x = (& * & temp (),);
458
460
# x ;
461
+ let x = pin! (temp ());
462
+ # x ;
459
463
let x = { [Some (& temp ()) ] };
460
464
# x ;
461
465
let ref x = temp ();
@@ -510,6 +514,7 @@ There is one additional case to be aware of: when a panic reaches a [non-unwindi
510
514
[ initialized ] : glossary.md#initialized
511
515
[ interior mutability ] : interior-mutability.md
512
516
[ lazy boolean expression ] : expressions/operator-expr.md#lazy-boolean-operators
517
+ [ macro invocation ] : macros.md#macro-invocation
513
518
[ non-unwinding ABI boundary ] : items/functions.md#unwinding
514
519
[ panic ] : panic.md
515
520
[ place context ] : expressions.md#place-expressions-and-value-expressions
@@ -554,3 +559,6 @@ There is one additional case to be aware of: when a panic reaches a [non-unwindi
554
559
[ `match` ] : expressions/match-expr.md
555
560
[ `while let` ] : expressions/loop-expr.md#while-let-patterns
556
561
[ `while` ] : expressions/loop-expr.md#predicate-loops
562
+
563
+ [ `pin!` ] : std::pin::pin
564
+ [ `format_args!` ] : core::format_args
0 commit comments