2018-10-08 18:03:24 -05:00
|
|
|
error[E0597]: `y` does not live long enough
|
2019-04-07 10:07:36 -05:00
|
|
|
--> $DIR/pattern_substs_on_brace_struct.rs:5:28
|
2018-10-08 18:03:24 -05:00
|
|
|
|
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | let y = 22;
|
|
|
|
| - binding `y` declared here
|
2018-10-08 18:03:24 -05:00
|
|
|
LL | let foo = Foo { field: &y };
|
|
|
|
| ^^ borrowed value does not live long enough
|
2019-03-09 06:03:44 -06:00
|
|
|
LL |
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | let Foo::<'static> { field: _z } = foo;
|
|
|
|
| ---------------------------- type annotation requires that `y` is borrowed for `'static`
|
2018-10-08 18:03:24 -05:00
|
|
|
LL | }
|
|
|
|
| - `y` dropped here while still borrowed
|
|
|
|
|
|
|
|
error[E0597]: `y` does not live long enough
|
2019-04-07 10:07:36 -05:00
|
|
|
--> $DIR/pattern_substs_on_brace_struct.rs:12:28
|
2018-10-08 18:03:24 -05:00
|
|
|
|
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | let y = 22;
|
|
|
|
| - binding `y` declared here
|
2018-10-08 18:03:24 -05:00
|
|
|
LL | let foo = Foo { field: &y };
|
|
|
|
| ^^ borrowed value does not live long enough
|
|
|
|
...
|
2018-10-14 09:12:02 -05:00
|
|
|
LL | Foo::<'static> { field: _z } => {
|
|
|
|
| ---------------------------- type annotation requires that `y` is borrowed for `'static`
|
|
|
|
...
|
2018-10-08 18:03:24 -05:00
|
|
|
LL | }
|
|
|
|
| - `y` dropped here while still borrowed
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|