2017-08-09 16:37:56 -07:00
|
|
|
error[E0597]: `a` does not live long enough
|
|
|
|
--> $DIR/borrowing.rs:18:20
|
|
|
|
|
|
|
|
|
18 | (|| yield &a).resume()
|
2017-12-13 17:27:23 -08:00
|
|
|
| -- ^ borrowed value does not live long enough
|
2017-08-09 16:37:56 -07:00
|
|
|
| |
|
|
|
|
| capture occurs here
|
|
|
|
19 | //~^ ERROR: `a` does not live long enough
|
|
|
|
20 | };
|
|
|
|
| - borrowed value only lives until here
|
|
|
|
...
|
|
|
|
29 | }
|
|
|
|
| - borrowed value needs to live until here
|
|
|
|
|
|
|
|
error[E0597]: `a` does not live long enough
|
|
|
|
--> $DIR/borrowing.rs:25:20
|
|
|
|
|
|
|
|
|
24 | || {
|
|
|
|
| -- capture occurs here
|
|
|
|
25 | yield &a
|
2017-12-13 17:27:23 -08:00
|
|
|
| ^ borrowed value does not live long enough
|
2017-08-09 16:37:56 -07:00
|
|
|
...
|
|
|
|
28 | };
|
|
|
|
| - borrowed value only lives until here
|
|
|
|
29 | }
|
|
|
|
| - borrowed value needs to live until here
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|