]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/adt-nullary-enums.stderr
Auto merge of #105716 - chriswailes:ndk-update-redux, r=pietroalbini
[rust.git] / tests / ui / nll / user-annotations / adt-nullary-enums.stderr
1 error[E0597]: `c` does not live long enough
2   --> $DIR/adt-nullary-enums.rs:33:41
3    |
4 LL | /     combine(
5 LL | |         SomeEnum::SomeVariant(Cell::new(&c)),
6    | |                                         ^^ borrowed value does not live long enough
7 LL | |         SomeEnum::SomeOtherVariant::<Cell<&'static u32>>,
8 LL | |     );
9    | |_____- argument requires that `c` is borrowed for `'static`
10 LL |   }
11    |   - `c` dropped here while still borrowed
12
13 error[E0597]: `c` does not live long enough
14   --> $DIR/adt-nullary-enums.rs:41:41
15    |
16 LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) {
17    |                                   -- lifetime `'a` defined here
18 ...
19 LL |         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 ...
25 LL | }
26    | - `c` dropped here while still borrowed
27
28 error[E0597]: `c` does not live long enough
29   --> $DIR/adt-nullary-enums.rs:54:45
30    |
31 LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
32    |                                              -- lifetime `'a` defined here
33 ...
34 LL |             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 ...
40 LL |     };
41    |     - `c` dropped here while still borrowed
42
43 error: aborting due to 3 previous errors
44
45 For more information about this error, try `rustc --explain E0597`.