rust/tests/ui/generator/borrowing.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
951 B
Plaintext
Raw Normal View History

2017-08-09 18:37:56 -05:00
error[E0597]: `a` does not live long enough
--> $DIR/borrowing.rs:13:33
2017-08-09 18:37:56 -05:00
|
LL | let _b = {
| -- borrow later stored here
LL | let a = 3;
LL | Pin::new(&mut || yield &a).resume(())
| -- ^ borrowed value does not live long enough
| |
| value captured here by generator
2019-03-09 06:03:44 -06:00
LL |
2018-02-22 18:42:32 -06:00
LL | };
| - `a` dropped here while still borrowed
2017-08-09 18:37:56 -05:00
error[E0597]: `a` does not live long enough
--> $DIR/borrowing.rs:20:20
2017-08-09 18:37:56 -05:00
|
LL | let _b = {
| -- borrow later stored here
LL | let a = 3;
2018-02-22 18:42:32 -06:00
LL | || {
| -- 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 | };
| - `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`.