fork/rust

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

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

master
2.0 KiB47 linesraw
1error[E0597]: `c` does not live long enough
2  --> $DIR/adt-brace-enums.rs:25:48
3   |
4LL |     let c = 66;
5   |         - binding `c` declared here
6LL |     SomeEnum::SomeVariant::<&'static u32> { t: &c };
7   |                                                ^^
8   |                                                |
9   |                                                borrowed value does not live long enough
10   |                                                this usage 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/adt-brace-enums.rs:30:43
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 |     SomeEnum::SomeVariant::<&'a u32> { t: &c };
22   |                                           ^^
23   |                                           |
24   |                                           borrowed value does not live long enough
25   |                                           this usage 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/adt-brace-enums.rs:40:47
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 |         SomeEnum::SomeVariant::<&'a u32> { t: &c };
38   |                                               ^^
39   |                                               |
40   |                                               borrowed value does not live long enough
41   |                                               this usage 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`.