fork/rust

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

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

master
2.1 KiB66 linesraw
1error[E0597]: `c` does not live long enough
2  --> $DIR/adt-tuple-struct-calls.rs:27:7
3   |
4LL |     let c = 66;
5   |         - binding `c` declared here
6LL |     let f = SomeStruct::<&'static u32>;
7LL |     f(&c);
8   |     --^^-
9   |     | |
10   |     | borrowed value does not live long enough
11   |     argument requires that `c` is borrowed for `'static`
12LL | }
13   | - `c` dropped here while still borrowed
14
15error[E0597]: `c` does not live long enough
16  --> $DIR/adt-tuple-struct-calls.rs:33:7
17   |
18LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) {
19   |                                   -- lifetime `'a` defined here
20LL |     let c = 66;
21   |         - binding `c` declared here
22LL |     let f = SomeStruct::<&'a u32>;
23LL |     f(&c);
24   |     --^^-
25   |     | |
26   |     | borrowed value does not live long enough
27   |     argument requires that `c` is borrowed for `'a`
28LL | }
29   | - `c` dropped here while still borrowed
30
31error[E0597]: `c` does not live long enough
32  --> $DIR/adt-tuple-struct-calls.rs:45:11
33   |
34LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
35   |                                              -- lifetime `'a` defined here
36LL |     let _closure = || {
37LL |         let c = 66;
38   |             - binding `c` declared here
39LL |         let f = SomeStruct::<&'a u32>;
40LL |         f(&c);
41   |         --^^-
42   |         | |
43   |         | borrowed value does not live long enough
44   |         argument requires that `c` is borrowed for `'a`
45LL |     };
46   |     - `c` dropped here while still borrowed
47
48error[E0597]: `c` does not live long enough
49  --> $DIR/adt-tuple-struct-calls.rs:53:11
50   |
51LL |     let f = SomeStruct::<&'a u32>;
52   |         - lifetime `'1` appears in the type of `f`
53LL |     let _closure = || {
54LL |         let c = 66;
55   |             - binding `c` declared here
56LL |         f(&c);
57   |         --^^-
58   |         | |
59   |         | borrowed value does not live long enough
60   |         argument requires that `c` is borrowed for `'1`
61LL |     };
62   |     - `c` dropped here while still borrowed
63
64error: aborting due to 4 previous errors
65
66For more information about this error, try `rustc --explain E0597`.