2017-08-09 18:37:56 -05:00
|
|
|
error[E0597]: `a` does not live long enough
|
2022-10-01 05:19:31 -05:00
|
|
|
--> $DIR/borrowing.rs:13:33
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
2020-03-14 18:24:47 -05:00
|
|
|
LL | let _b = {
|
|
|
|
| -- borrow later stored here
|
|
|
|
LL | let a = 3;
|
2020-01-25 13:03:10 -06:00
|
|
|
LL | Pin::new(&mut || yield &a).resume(())
|
2020-03-14 18:24:47 -05:00
|
|
|
| -- ^ borrowed value does not live long enough
|
|
|
|
| |
|
2019-04-22 02:40:08 -05:00
|
|
|
| value captured here by generator
|
2019-03-09 06:03:44 -06:00
|
|
|
LL |
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | };
|
2020-03-14 18:24:47 -05:00
|
|
|
| - `a` dropped here while still borrowed
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
|
|
error[E0597]: `a` does not live long enough
|
2022-10-01 05:19:31 -05:00
|
|
|
--> $DIR/borrowing.rs:20:20
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | let _b = {
|
|
|
|
| -- borrow later stored here
|
|
|
|
LL | let a = 3;
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | || {
|
2019-04-22 02:40:08 -05:00
|
|
|
| -- value captured here by generator
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | yield &a
|
2017-12-13 19:27:23 -06:00
|
|
|
| ^ borrowed value does not live long enough
|
2017-08-09 18:37:56 -05:00
|
|
|
...
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | };
|
2019-04-22 02:40:08 -05:00
|
|
|
| - `a` dropped here while still borrowed
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2018-03-03 08:59:40 -06:00
|
|
|
For more information about this error, try `rustc --explain E0597`.
|