]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/method-ufcs-inherent-2.stderr
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / nll / user-annotations / method-ufcs-inherent-2.stderr
1 error[E0597]: `v` does not live long enough
2   --> $DIR/method-ufcs-inherent-2.rs:14:37
3    |
4 LL | fn foo<'a>() {
5    |        -- lifetime `'a` defined here
6 LL |     let v = 22;
7 LL |     let x = A::<'a>::new::<&'a u32>(&v, &v);
8    |             ------------------------^^-----
9    |             |                       |
10    |             |                       borrowed value does not live long enough
11    |             argument requires that `v` is borrowed for `'a`
12 ...
13 LL | }
14    | - `v` dropped here while still borrowed
15
16 error[E0597]: `v` does not live long enough
17   --> $DIR/method-ufcs-inherent-2.rs:14:41
18    |
19 LL | fn foo<'a>() {
20    |        -- lifetime `'a` defined here
21 LL |     let v = 22;
22 LL |     let x = A::<'a>::new::<&'a u32>(&v, &v);
23    |             ----------------------------^^-
24    |             |                           |
25    |             |                           borrowed value does not live long enough
26    |             argument requires that `v` is borrowed for `'a`
27 ...
28 LL | }
29    | - `v` dropped here while still borrowed
30
31 error: aborting due to 2 previous errors
32
33 For more information about this error, try `rustc --explain E0597`.