about summary refs log tree commit diff
path: root/tests/ui/nll/nested-bodies-in-dead-code.stderr
blob: da6ccff5777cde183c58d20a32df9b375eadde8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
error: lifetime may not live long enough
  --> $DIR/nested-bodies-in-dead-code.rs:9:33
   |
LL |     |x: &str| -> &'static str { x };
   |         -                       ^ returning this value requires that `'1` must outlive `'static`
   |         |
   |         let's call the lifetime of this reference `'1`

error[E0597]: `temp` does not live long enough
  --> $DIR/nested-bodies-in-dead-code.rs:14:35
   |
LL |             let temp = 1;
   |                 ---- binding `temp` declared here
LL |             let p: &'static u32 = &temp;
   |                    ------------   ^^^^^ borrowed value does not live long enough
   |                    |
   |                    type annotation requires that `temp` is borrowed for `'static`
LL |
LL |         };
   |         - `temp` dropped here while still borrowed

error[E0597]: `temp` does not live long enough
  --> $DIR/nested-bodies-in-dead-code.rs:20:31
   |
LL |         let temp = 1;
   |             ---- binding `temp` declared here
LL |         let p: &'static u32 = &temp;
   |                ------------   ^^^^^ borrowed value does not live long enough
   |                |
   |                type annotation requires that `temp` is borrowed for `'static`
LL |
LL |     };
   |     - `temp` dropped here while still borrowed

error[E0597]: `temp` does not live long enough
  --> $DIR/nested-bodies-in-dead-code.rs:25:31
   |
LL |         let temp = 1;
   |             ---- binding `temp` declared here
LL |         let p: &'static u32 = &temp;
   |                ------------   ^^^^^ borrowed value does not live long enough
   |                |
   |                type annotation requires that `temp` is borrowed for `'static`
LL |
LL |     };
   |     - `temp` dropped here while still borrowed

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0597`.