]> git.lizzy.rs Git - rust.git/blob - src/test/ui/region-borrow-params-issue-29793-small.nll.stderr
Rollup merge of #52695 - oli-obk:const_err_panic, r=petrochenkov
[rust.git] / src / test / ui / region-borrow-params-issue-29793-small.nll.stderr
1 error[E0597]: `x` does not live long enough
2   --> $DIR/region-borrow-params-issue-29793-small.rs:19:17
3    |
4 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
5    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
6 ...
7 LL |     };
8    |      - `x` dropped here while still borrowed
9
10 error[E0597]: `y` does not live long enough
11   --> $DIR/region-borrow-params-issue-29793-small.rs:19:17
12    |
13 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
14    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
15 ...
16 LL |     };
17    |      - `y` dropped here while still borrowed
18
19 error[E0597]: `x` does not live long enough
20   --> $DIR/region-borrow-params-issue-29793-small.rs:34:17
21    |
22 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
23    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
24 ...
25 LL |     };
26    |      - `x` dropped here while still borrowed
27
28 error[E0597]: `y` does not live long enough
29   --> $DIR/region-borrow-params-issue-29793-small.rs:34:17
30    |
31 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
32    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
33 ...
34 LL |     };
35    |      - `y` dropped here while still borrowed
36
37 error[E0597]: `x` does not live long enough
38   --> $DIR/region-borrow-params-issue-29793-small.rs:65:17
39    |
40 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
41    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
42 ...
43 LL |     };
44    |     - `x` dropped here while still borrowed
45    |
46 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 64:10...
47   --> $DIR/region-borrow-params-issue-29793-small.rs:64:10
48    |
49 LL |     fn g<'a>(x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
50    |          ^^
51
52 error[E0597]: `y` does not live long enough
53   --> $DIR/region-borrow-params-issue-29793-small.rs:65:17
54    |
55 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
56    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
57 ...
58 LL |     };
59    |     - `y` dropped here while still borrowed
60    |
61 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 64:10...
62   --> $DIR/region-borrow-params-issue-29793-small.rs:64:10
63    |
64 LL |     fn g<'a>(x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
65    |          ^^
66
67 error[E0597]: `x` does not live long enough
68   --> $DIR/region-borrow-params-issue-29793-small.rs:76:17
69    |
70 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
71    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
72 ...
73 LL |     };
74    |     - `x` dropped here while still borrowed
75    |
76 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 75:10...
77   --> $DIR/region-borrow-params-issue-29793-small.rs:75:10
78    |
79 LL |     fn g<'a>(x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
80    |          ^^
81
82 error[E0597]: `y` does not live long enough
83   --> $DIR/region-borrow-params-issue-29793-small.rs:76:17
84    |
85 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
86    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
87 ...
88 LL |     };
89    |     - `y` dropped here while still borrowed
90    |
91 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 75:10...
92   --> $DIR/region-borrow-params-issue-29793-small.rs:75:10
93    |
94 LL |     fn g<'a>(x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
95    |          ^^
96
97 error[E0597]: `x` does not live long enough
98   --> $DIR/region-borrow-params-issue-29793-small.rs:100:21
99    |
100 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
101    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
102 ...
103 LL |         }
104    |         - `x` dropped here while still borrowed
105    |
106 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 99:14...
107   --> $DIR/region-borrow-params-issue-29793-small.rs:99:14
108    |
109 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
110    |              ^^
111
112 error[E0597]: `y` does not live long enough
113   --> $DIR/region-borrow-params-issue-29793-small.rs:100:21
114    |
115 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
116    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
117 ...
118 LL |         }
119    |         - `y` dropped here while still borrowed
120    |
121 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 99:14...
122   --> $DIR/region-borrow-params-issue-29793-small.rs:99:14
123    |
124 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
125    |              ^^
126
127 error[E0597]: `x` does not live long enough
128   --> $DIR/region-borrow-params-issue-29793-small.rs:114:21
129    |
130 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
131    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
132 ...
133 LL |         }
134    |         - `x` dropped here while still borrowed
135    |
136 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 113:14...
137   --> $DIR/region-borrow-params-issue-29793-small.rs:113:14
138    |
139 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
140    |              ^^
141
142 error[E0597]: `y` does not live long enough
143   --> $DIR/region-borrow-params-issue-29793-small.rs:114:21
144    |
145 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
146    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
147 ...
148 LL |         }
149    |         - `y` dropped here while still borrowed
150    |
151 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 113:14...
152   --> $DIR/region-borrow-params-issue-29793-small.rs:113:14
153    |
154 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
155    |              ^^
156
157 error[E0597]: `x` does not live long enough
158   --> $DIR/region-borrow-params-issue-29793-small.rs:142:21
159    |
160 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
161    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
162 ...
163 LL |         }
164    |         - `x` dropped here while still borrowed
165    |
166 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 141:14...
167   --> $DIR/region-borrow-params-issue-29793-small.rs:141:14
168    |
169 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
170    |              ^^
171
172 error[E0597]: `y` does not live long enough
173   --> $DIR/region-borrow-params-issue-29793-small.rs:142:21
174    |
175 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
176    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
177 ...
178 LL |         }
179    |         - `y` dropped here while still borrowed
180    |
181 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 141:14...
182   --> $DIR/region-borrow-params-issue-29793-small.rs:141:14
183    |
184 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
185    |              ^^
186
187 error[E0597]: `x` does not live long enough
188   --> $DIR/region-borrow-params-issue-29793-small.rs:157:21
189    |
190 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
191    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
192 ...
193 LL |         }
194    |         - `x` dropped here while still borrowed
195    |
196 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 156:14...
197   --> $DIR/region-borrow-params-issue-29793-small.rs:156:14
198    |
199 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
200    |              ^^
201
202 error[E0597]: `y` does not live long enough
203   --> $DIR/region-borrow-params-issue-29793-small.rs:157:21
204    |
205 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
206    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
207 ...
208 LL |         }
209    |         - `y` dropped here while still borrowed
210    |
211 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 156:14...
212   --> $DIR/region-borrow-params-issue-29793-small.rs:156:14
213    |
214 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
215    |              ^^
216
217 error[E0597]: `x` does not live long enough
218   --> $DIR/region-borrow-params-issue-29793-small.rs:185:21
219    |
220 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
221    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
222 ...
223 LL |         }
224    |         - `x` dropped here while still borrowed
225    |
226 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 184:14...
227   --> $DIR/region-borrow-params-issue-29793-small.rs:184:14
228    |
229 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
230    |              ^^
231
232 error[E0597]: `y` does not live long enough
233   --> $DIR/region-borrow-params-issue-29793-small.rs:185:21
234    |
235 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
236    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
237 ...
238 LL |         }
239    |         - `y` dropped here while still borrowed
240    |
241 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 184:14...
242   --> $DIR/region-borrow-params-issue-29793-small.rs:184:14
243    |
244 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
245    |              ^^
246
247 error[E0597]: `x` does not live long enough
248   --> $DIR/region-borrow-params-issue-29793-small.rs:199:21
249    |
250 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
251    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
252 ...
253 LL |         }
254    |         - `x` dropped here while still borrowed
255    |
256 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 198:14...
257   --> $DIR/region-borrow-params-issue-29793-small.rs:198:14
258    |
259 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
260    |              ^^
261
262 error[E0597]: `y` does not live long enough
263   --> $DIR/region-borrow-params-issue-29793-small.rs:199:21
264    |
265 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
266    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
267 ...
268 LL |         }
269    |         - `y` dropped here while still borrowed
270    |
271 note: borrowed value must be valid for the lifetime 'a as defined on the method body at 198:14...
272   --> $DIR/region-borrow-params-issue-29793-small.rs:198:14
273    |
274 LL |         fn g<'a>(&self, x: usize, y:usize) -> Box<Fn(bool) -> usize + 'a> {
275    |              ^^
276
277 error: aborting due to 20 previous errors
278
279 For more information about this error, try `rustc --explain E0597`.