fork/rust

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

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

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