summary refs log tree commit diff
path: root/src/test/ui/nll/user-annotations/patterns.stderr
blob: 563de1a9e02e0caf99742ee945905e31b18eca4d (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:8:9
   |
LL |     y = &x; //~ ERROR
   |         ^^ borrowed value does not live long enough
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:22:13
   |
LL |     let y = &x; //~ ERROR
   |             ^^ borrowed value does not live long enough
...
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:46:27
   |
LL |     let y: &'static u32 = &x; //~ ERROR
   |                           ^^ borrowed value does not live long enough
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:51:27
   |
LL |     let _: &'static u32 = &x; //~ ERROR
   |                           ^^ borrowed value does not live long enough
...
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: borrowed value does not live long enough
  --> $DIR/patterns.rs:53:41
   |
LL |     let _: Vec<&'static String> = vec![&String::new()];
   |                                         ^^^^^^^^^^^^^ - temporary value only lives until here
   |                                         |
   |                                         temporary value does not live long enough
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: borrowed value does not live long enough
  --> $DIR/patterns.rs:56:52
   |
LL |     let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
   |                                                    ^^^^^^^^^^^^^      - temporary value only lives until here
   |                                                    |
   |                                                    temporary value does not live long enough
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: borrowed value does not live long enough
  --> $DIR/patterns.rs:59:53
   |
LL |     let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
   |                                                     ^^^^^^^^^^^^^      - temporary value only lives until here
   |                                                     |
   |                                                     temporary value does not live long enough
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:65:40
   |
LL |     let (_, _): (&'static u32, u32) = (&x, 44); //~ ERROR
   |                                        ^^ borrowed value does not live long enough
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:70:40
   |
LL |     let (y, _): (&'static u32, u32) = (&x, 44); //~ ERROR
   |                                        ^^ borrowed value does not live long enough
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:75:69
   |
LL |     let Single { value: y }: Single<&'static u32> = Single { value: &x }; //~ ERROR
   |                                                                     ^^ borrowed value does not live long enough
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:80:69
   |
LL |     let Single { value: _ }: Single<&'static u32> = Single { value: &x }; //~ ERROR
   |                                                                     ^^ borrowed value does not live long enough
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error[E0597]: `x` does not live long enough
  --> $DIR/patterns.rs:88:17
   |
LL |         value1: &x, //~ ERROR
   |                 ^^ borrowed value does not live long enough
...
LL | }
   | - `x` dropped here while still borrowed
   |
   = note: borrowed value must be valid for the static lifetime...

error: unsatisfied lifetime constraints
  --> $DIR/patterns.rs:101:5
   |
LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
   |                                           -- lifetime `'a` defined here
...
LL |     y //~ ERROR
   |     ^ returning this value requires that `'a` must outlive `'static`

error: unsatisfied lifetime constraints
  --> $DIR/patterns.rs:117:40
   |
LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 {
   |                            -- lifetime `'a` defined here
LL |     let (y, _z): (&'static u32, u32) = (x, 44); //~ ERROR
   |                                        ^^^^^^^ requires that `'a` must outlive `'static`

error: aborting due to 14 previous errors

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