File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -435,6 +435,8 @@ expression which is one of the following:
435
435
expression.
436
436
* The arguments to an extending [ tuple struct] or [ tuple variant] constructor expression.
437
437
* The final expression of any extending [ block expression] .
438
+ * The arm(s) of an extending [ ` match ` ] expression.
439
+ * The final expressions of an extending [ ` if ` ] expression's consequent, ` else if ` , and ` else ` blocks.
438
440
439
441
So the borrow expressions in ` &mut 0 ` , ` (&1, &mut 2) ` , and ` Some(&mut 3) `
440
442
are all extending expressions. The borrows in ` &0 + &1 ` and ` f(&mut 0) ` are not.
@@ -458,6 +460,10 @@ let x = (&*&temp(),);
458
460
# x ;
459
461
let x = { [Some (& temp ()) ] };
460
462
# x ;
463
+ let x = match () { _ => & temp () };
464
+ # x ;
465
+ let x = if true { & temp () } else { & temp () };
466
+ # x ;
461
467
let ref x = temp ();
462
468
# x ;
463
469
let ref x = * & temp ();
@@ -477,6 +483,8 @@ let x = std::convert::identity(&temp()); // ERROR
477
483
# x;
478
484
let x = (&temp()).use_temp(); // ERROR
479
485
# x;
486
+ let x = match &temp() { x => x }; // ERROR
487
+ # x;
480
488
```
481
489
482
490
r[ destructors.forget]
You can’t perform that action at this time.
0 commit comments