fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.6 KiB46 linesraw
1error[E0597]: `a` does not live long enough
2  --> $DIR/method-ufcs-1.rs:30:7
3   |
4LL |     x(&a, b, c);
5   |     --^^-------
6   |     | |
7   |     | borrowed value does not live long enough
8   |     argument requires that `a` is borrowed for `'static`
9LL | }
10   | - `a` dropped here while still borrowed
11
12error[E0597]: `a` does not live long enough
13  --> $DIR/method-ufcs-1.rs:37:36
14   |
15LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) {
16   |                                   -- lifetime `'a` defined here
17...
18LL |     <&'a u32 as Bazoom<_>>::method(&a, b, c);
19   |     -------------------------------^^-------
20   |     |                              |
21   |     |                              borrowed value does not live long enough
22   |     argument requires that `a` is borrowed for `'a`
23LL | }
24   | - `a` dropped here while still borrowed
25
26error[E0597]: `a` does not live long enough
27  --> $DIR/method-ufcs-1.rs:51:41
28   |
29LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
30   |                                              -- lifetime `'a` defined here
31...
32LL |     let _closure = || {
33   |                    -- value captured here
34LL |         let c = 66;
35LL |         <&'a u32 as Bazoom<_>>::method(&a, b, c);
36   |         --------------------------------^-------
37   |         |                               |
38   |         |                               borrowed value does not live long enough
39   |         argument requires that `a` is borrowed for `'a`
40LL |     };
41LL | }
42   | - `a` dropped here while still borrowed
43
44error: aborting due to 3 previous errors
45
46For more information about this error, try `rustc --explain E0597`.