]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-borrow-params-issue-29793-small.nll.stderr
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / regions / region-borrow-params-issue-29793-small.nll.stderr
1 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
2   --> $DIR/region-borrow-params-issue-29793-small.rs:9:17
3    |
4 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
5    |                 ^^^^^^^^^        - `x` is borrowed here
6    |                 |
7    |                 may outlive borrowed value `x`
8    |
9 note: closure is returned here
10   --> $DIR/region-borrow-params-issue-29793-small.rs:12:16
11    |
12 LL |         return f;
13    |                ^
14 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
15    |
16 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
17    |                 ^^^^^^^^^^^^^^
18
19 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
20   --> $DIR/region-borrow-params-issue-29793-small.rs:9:17
21    |
22 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
23    |                 ^^^^^^^^^                   - `y` is borrowed here
24    |                 |
25    |                 may outlive borrowed value `y`
26    |
27 note: closure is returned here
28   --> $DIR/region-borrow-params-issue-29793-small.rs:12:16
29    |
30 LL |         return f;
31    |                ^
32 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
33    |
34 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
35    |                 ^^^^^^^^^^^^^^
36
37 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
38   --> $DIR/region-borrow-params-issue-29793-small.rs:24:17
39    |
40 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
41    |                 ^^^^^^^^^        - `x` is borrowed here
42    |                 |
43    |                 may outlive borrowed value `x`
44    |
45 note: closure is returned here
46   --> $DIR/region-borrow-params-issue-29793-small.rs:27:9
47    |
48 LL |         f
49    |         ^
50 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
51    |
52 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
53    |                 ^^^^^^^^^^^^^^
54
55 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
56   --> $DIR/region-borrow-params-issue-29793-small.rs:24:17
57    |
58 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
59    |                 ^^^^^^^^^                   - `y` is borrowed here
60    |                 |
61    |                 may outlive borrowed value `y`
62    |
63 note: closure is returned here
64   --> $DIR/region-borrow-params-issue-29793-small.rs:27:9
65    |
66 LL |         f
67    |         ^
68 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
69    |
70 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
71    |                 ^^^^^^^^^^^^^^
72
73 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
74   --> $DIR/region-borrow-params-issue-29793-small.rs:55:17
75    |
76 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
77    |                 ^^^^^^^^^        - `x` is borrowed here
78    |                 |
79    |                 may outlive borrowed value `x`
80    |
81 note: closure is returned here
82   --> $DIR/region-borrow-params-issue-29793-small.rs:58:16
83    |
84 LL |         return Box::new(f);
85    |                ^^^^^^^^^^^
86 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
87    |
88 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
89    |                 ^^^^^^^^^^^^^^
90
91 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
92   --> $DIR/region-borrow-params-issue-29793-small.rs:55:17
93    |
94 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
95    |                 ^^^^^^^^^                   - `y` is borrowed here
96    |                 |
97    |                 may outlive borrowed value `y`
98    |
99 note: closure is returned here
100   --> $DIR/region-borrow-params-issue-29793-small.rs:58:16
101    |
102 LL |         return Box::new(f);
103    |                ^^^^^^^^^^^
104 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
105    |
106 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
107    |                 ^^^^^^^^^^^^^^
108
109 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
110   --> $DIR/region-borrow-params-issue-29793-small.rs:66:17
111    |
112 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
113    |                 ^^^^^^^^^        - `x` is borrowed here
114    |                 |
115    |                 may outlive borrowed value `x`
116    |
117 note: closure is returned here
118   --> $DIR/region-borrow-params-issue-29793-small.rs:69:9
119    |
120 LL |         Box::new(f)
121    |         ^^^^^^^^^^^
122 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
123    |
124 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
125    |                 ^^^^^^^^^^^^^^
126
127 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
128   --> $DIR/region-borrow-params-issue-29793-small.rs:66:17
129    |
130 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
131    |                 ^^^^^^^^^                   - `y` is borrowed here
132    |                 |
133    |                 may outlive borrowed value `y`
134    |
135 note: closure is returned here
136   --> $DIR/region-borrow-params-issue-29793-small.rs:69:9
137    |
138 LL |         Box::new(f)
139    |         ^^^^^^^^^^^
140 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
141    |
142 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
143    |                 ^^^^^^^^^^^^^^
144
145 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
146   --> $DIR/region-borrow-params-issue-29793-small.rs:90:21
147    |
148 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
149    |                     ^^^^^^^^^        - `x` is borrowed here
150    |                     |
151    |                     may outlive borrowed value `x`
152    |
153 note: closure is returned here
154   --> $DIR/region-borrow-params-issue-29793-small.rs:93:20
155    |
156 LL |             return Box::new(f);
157    |                    ^^^^^^^^^^^
158 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
159    |
160 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
161    |                     ^^^^^^^^^^^^^^
162
163 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
164   --> $DIR/region-borrow-params-issue-29793-small.rs:90:21
165    |
166 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
167    |                     ^^^^^^^^^                   - `y` is borrowed here
168    |                     |
169    |                     may outlive borrowed value `y`
170    |
171 note: closure is returned here
172   --> $DIR/region-borrow-params-issue-29793-small.rs:93:20
173    |
174 LL |             return Box::new(f);
175    |                    ^^^^^^^^^^^
176 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
177    |
178 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
179    |                     ^^^^^^^^^^^^^^
180
181 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
182   --> $DIR/region-borrow-params-issue-29793-small.rs:104:21
183    |
184 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
185    |                     ^^^^^^^^^        - `x` is borrowed here
186    |                     |
187    |                     may outlive borrowed value `x`
188    |
189 note: closure is returned here
190   --> $DIR/region-borrow-params-issue-29793-small.rs:107:13
191    |
192 LL |             Box::new(f)
193    |             ^^^^^^^^^^^
194 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
195    |
196 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
197    |                     ^^^^^^^^^^^^^^
198
199 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
200   --> $DIR/region-borrow-params-issue-29793-small.rs:104:21
201    |
202 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
203    |                     ^^^^^^^^^                   - `y` is borrowed here
204    |                     |
205    |                     may outlive borrowed value `y`
206    |
207 note: closure is returned here
208   --> $DIR/region-borrow-params-issue-29793-small.rs:107:13
209    |
210 LL |             Box::new(f)
211    |             ^^^^^^^^^^^
212 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
213    |
214 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
215    |                     ^^^^^^^^^^^^^^
216
217 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
218   --> $DIR/region-borrow-params-issue-29793-small.rs:132:21
219    |
220 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
221    |                     ^^^^^^^^^        - `x` is borrowed here
222    |                     |
223    |                     may outlive borrowed value `x`
224    |
225 note: closure is returned here
226   --> $DIR/region-borrow-params-issue-29793-small.rs:135:20
227    |
228 LL |             return Box::new(f);
229    |                    ^^^^^^^^^^^
230 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
231    |
232 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
233    |                     ^^^^^^^^^^^^^^
234
235 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
236   --> $DIR/region-borrow-params-issue-29793-small.rs:132:21
237    |
238 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
239    |                     ^^^^^^^^^                   - `y` is borrowed here
240    |                     |
241    |                     may outlive borrowed value `y`
242    |
243 note: closure is returned here
244   --> $DIR/region-borrow-params-issue-29793-small.rs:135:20
245    |
246 LL |             return Box::new(f);
247    |                    ^^^^^^^^^^^
248 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
249    |
250 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
251    |                     ^^^^^^^^^^^^^^
252
253 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
254   --> $DIR/region-borrow-params-issue-29793-small.rs:147:21
255    |
256 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
257    |                     ^^^^^^^^^        - `x` is borrowed here
258    |                     |
259    |                     may outlive borrowed value `x`
260    |
261 note: closure is returned here
262   --> $DIR/region-borrow-params-issue-29793-small.rs:150:13
263    |
264 LL |             Box::new(f)
265    |             ^^^^^^^^^^^
266 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
267    |
268 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
269    |                     ^^^^^^^^^^^^^^
270
271 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
272   --> $DIR/region-borrow-params-issue-29793-small.rs:147:21
273    |
274 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
275    |                     ^^^^^^^^^                   - `y` is borrowed here
276    |                     |
277    |                     may outlive borrowed value `y`
278    |
279 note: closure is returned here
280   --> $DIR/region-borrow-params-issue-29793-small.rs:150:13
281    |
282 LL |             Box::new(f)
283    |             ^^^^^^^^^^^
284 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
285    |
286 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
287    |                     ^^^^^^^^^^^^^^
288
289 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
290   --> $DIR/region-borrow-params-issue-29793-small.rs:175:21
291    |
292 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
293    |                     ^^^^^^^^^        - `x` is borrowed here
294    |                     |
295    |                     may outlive borrowed value `x`
296    |
297 note: closure is returned here
298   --> $DIR/region-borrow-params-issue-29793-small.rs:178:20
299    |
300 LL |             return Box::new(f);
301    |                    ^^^^^^^^^^^
302 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
303    |
304 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
305    |                     ^^^^^^^^^^^^^^
306
307 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
308   --> $DIR/region-borrow-params-issue-29793-small.rs:175:21
309    |
310 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
311    |                     ^^^^^^^^^                   - `y` is borrowed here
312    |                     |
313    |                     may outlive borrowed value `y`
314    |
315 note: closure is returned here
316   --> $DIR/region-borrow-params-issue-29793-small.rs:178:20
317    |
318 LL |             return Box::new(f);
319    |                    ^^^^^^^^^^^
320 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
321    |
322 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
323    |                     ^^^^^^^^^^^^^^
324
325 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
326   --> $DIR/region-borrow-params-issue-29793-small.rs:189:21
327    |
328 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
329    |                     ^^^^^^^^^        - `x` is borrowed here
330    |                     |
331    |                     may outlive borrowed value `x`
332    |
333 note: closure is returned here
334   --> $DIR/region-borrow-params-issue-29793-small.rs:192:13
335    |
336 LL |             Box::new(f)
337    |             ^^^^^^^^^^^
338 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
339    |
340 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
341    |                     ^^^^^^^^^^^^^^
342
343 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
344   --> $DIR/region-borrow-params-issue-29793-small.rs:189:21
345    |
346 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
347    |                     ^^^^^^^^^                   - `y` is borrowed here
348    |                     |
349    |                     may outlive borrowed value `y`
350    |
351 note: closure is returned here
352   --> $DIR/region-borrow-params-issue-29793-small.rs:192:13
353    |
354 LL |             Box::new(f)
355    |             ^^^^^^^^^^^
356 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
357    |
358 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
359    |                     ^^^^^^^^^^^^^^
360
361 error: aborting due to 20 previous errors
362
363 For more information about this error, try `rustc --explain E0373`.