fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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