2017-12-11 17:29:31 +00:00
|
|
|
error[E0597]: `y` does not live long enough
|
2019-04-07 16:07:36 +01:00
|
|
|
--> $DIR/capture-ref-in-struct.rs:18:16
|
2017-11-22 17:39:46 -05:00
|
|
|
|
|
2023-01-15 03:06:44 +00:00
|
|
|
LL | let y = 22;
|
|
|
|
| - binding `y` declared here
|
|
|
|
...
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | y: &y,
|
2017-12-14 09:57:34 -08:00
|
|
|
| ^^ borrowed value does not live long enough
|
2017-11-22 17:39:46 -05:00
|
|
|
...
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | }
|
2018-07-22 16:02:31 +01:00
|
|
|
| - `y` dropped here while still borrowed
|
2022-06-08 21:07:59 +03:00
|
|
|
LL |
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | deref(p);
|
2017-12-12 17:29:37 -03:00
|
|
|
| - borrow later used here
|
2017-11-22 17:39:46 -05:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2017-11-22 17:39:46 -05:00
|
|
|
|
2018-03-03 15:59:40 +01:00
|
|
|
For more information about this error, try `rustc --explain E0597`.
|