fork/rust

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

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

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