fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.1 KiB33 linesraw
1error[E0597]: `v` does not live long enough
2  --> $DIR/method-ufcs-inherent-2.rs:14:37
3   |
4LL | fn foo<'a>() {
5   |        -- lifetime `'a` defined here
6LL |     let v = 22;
7LL |     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...
13LL | }
14   | - `v` dropped here while still borrowed
15
16error[E0597]: `v` does not live long enough
17  --> $DIR/method-ufcs-inherent-2.rs:14:41
18   |
19LL | fn foo<'a>() {
20   |        -- lifetime `'a` defined here
21LL |     let v = 22;
22LL |     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...
28LL | }
29   | - `v` dropped here while still borrowed
30
31error: aborting due to 2 previous errors
32
33For more information about this error, try `rustc --explain E0597`.