File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -448,15 +448,18 @@ Here are some examples where expressions have extended temporary scopes:
448
448
449
449
``` rust
450
450
# fn temp () {}
451
- # trait Use { fn use_temp (& self ) -> & Self { self } }
452
- # impl Use for () {}
453
451
// The temporary that stores the result of `temp()` lives in the same scope
454
452
// as x in these cases.
455
453
let x = & temp ();
454
+ # x ;
456
455
let x = & temp () as & dyn Send ;
456
+ # x ;
457
457
let x = (& * & temp (),);
458
+ # x ;
458
459
let x = { [Some (& temp ()) ] };
460
+ # x ;
459
461
let ref x = temp ();
462
+ # x ;
460
463
let ref x = * & temp ();
461
464
# x ;
462
465
```
@@ -471,6 +474,7 @@ Here are some examples where expressions don't have extended temporary scopes:
471
474
// end of the let statement in these cases.
472
475
473
476
let x = std::convert::identity(&temp()); // ERROR
477
+ # x;
474
478
let x = (&temp()).use_temp(); // ERROR
475
479
# x;
476
480
```
You can’t perform that action at this time.
0 commit comments