fork/rust

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

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

master
1.9 KiB47 linesraw
1error[E0597]: `c` does not live long enough
2  --> $DIR/adt-brace-structs.rs:23:37
3   |
4LL |     let c = 66;
5   |         - binding `c` declared here
6LL |     SomeStruct::<&'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-structs.rs:28:32
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 |     SomeStruct::<&'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-structs.rs:38:36
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 |         SomeStruct::<&'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`.