]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.stderr
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / nll / user-annotations / pattern_substs_on_tuple_enum_variant.stderr
1 error[E0597]: `y` does not live long enough
2   --> $DIR/pattern_substs_on_tuple_enum_variant.rs:7:24
3    |
4 LL |     let foo = Foo::Bar(&y);
5    |                        ^^ borrowed value does not live long enough
6 LL |
7 LL |     let Foo::Bar::<'static>(_z) = foo;
8    |         ----------------------- type annotation requires that `y` is borrowed for `'static`
9 LL | }
10    | - `y` dropped here while still borrowed
11
12 error[E0597]: `y` does not live long enough
13   --> $DIR/pattern_substs_on_tuple_enum_variant.rs:14:24
14    |
15 LL |     let foo = Foo::Bar(&y);
16    |                        ^^ borrowed value does not live long enough
17 ...
18 LL |         Foo::Bar::<'static>(_z) => {
19    |         ----------------------- type annotation requires that `y` is borrowed for `'static`
20 ...
21 LL | }
22    | - `y` dropped here while still borrowed
23
24 error: aborting due to 2 previous errors
25
26 For more information about this error, try `rustc --explain E0597`.