2016-10-14 10:55:45 -05:00
|
|
|
error: `y` does not live long enough
|
|
|
|
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:21:1
|
|
|
|
|
|
|
|
|
20 | y.borrow().clone()
|
|
|
|
| - borrow occurs here
|
|
|
|
21 | }
|
|
|
|
| ^ `y` dropped here while still borrowed
|
|
|
|
|
|
|
|
|
= note: values in a scope are dropped in the opposite order they are created
|
|
|
|
|
|
|
|
error: `y` does not live long enough
|
2016-10-26 11:10:39 -05:00
|
|
|
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:28:5
|
2016-10-14 10:55:45 -05:00
|
|
|
|
|
|
|
|
27 | y.borrow().clone() //~ ERROR `y` does not live long enough
|
2016-10-26 11:10:39 -05:00
|
|
|
| - borrow occurs here
|
2016-10-14 10:55:45 -05:00
|
|
|
28 | };
|
2016-10-26 11:10:39 -05:00
|
|
|
| ^- borrowed value needs to live until here
|
2016-10-14 10:55:45 -05:00
|
|
|
| |
|
2016-10-26 11:10:39 -05:00
|
|
|
| `y` dropped here while still borrowed
|
2016-10-14 10:55:45 -05:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|