fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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