]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr
74f3a63be57de2886d2c28b829c06b56532d185c
[rust.git] / src / test / ui / suggestions / dont-suggest-ref / move-into-closure.stderr
1 error[E0507]: cannot move out of captured variable in an `Fn` closure
2   --> $DIR/move-into-closure.rs:28:21
3    |
4 LL |     let x = X(Y);
5    |         - captured outer variable
6 ...
7 LL |         let X(_t) = x;
8    |               --    ^
9    |               |     |
10    |               |     cannot move out of captured variable in an `Fn` closure
11    |               |     help: consider borrowing here: `&x`
12    |               data moved here
13    |
14 note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
15   --> $DIR/move-into-closure.rs:28:15
16    |
17 LL |         let X(_t) = x;
18    |               ^^
19
20 error[E0507]: cannot move out of captured variable in an `Fn` closure
21   --> $DIR/move-into-closure.rs:32:34
22    |
23 LL |     let e = Either::One(X(Y));
24    |         - captured outer variable
25 ...
26 LL |         if let Either::One(_t) = e { }
27    |                            --    ^
28    |                            |     |
29    |                            |     cannot move out of captured variable in an `Fn` closure
30    |                            |     help: consider borrowing here: `&e`
31    |                            data moved here
32    |
33 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
34   --> $DIR/move-into-closure.rs:32:28
35    |
36 LL |         if let Either::One(_t) = e { }
37    |                            ^^
38
39 error[E0507]: cannot move out of captured variable in an `Fn` closure
40   --> $DIR/move-into-closure.rs:36:37
41    |
42 LL |     let e = Either::One(X(Y));
43    |         - captured outer variable
44 ...
45 LL |         while let Either::One(_t) = e { }
46    |                               --    ^
47    |                               |     |
48    |                               |     cannot move out of captured variable in an `Fn` closure
49    |                               |     help: consider borrowing here: `&e`
50    |                               data moved here
51    |
52 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
53   --> $DIR/move-into-closure.rs:36:31
54    |
55 LL |         while let Either::One(_t) = e { }
56    |                               ^^
57
58 error[E0507]: cannot move out of captured variable in an `Fn` closure
59   --> $DIR/move-into-closure.rs:40:15
60    |
61 LL |     let e = Either::One(X(Y));
62    |         - captured outer variable
63 ...
64 LL |         match e {
65    |               ^
66    |               |
67    |               cannot move out of captured variable in an `Fn` closure
68    |               help: consider borrowing here: `&e`
69 ...
70 LL |             Either::One(_t)
71    |                         -- data moved here
72    |
73 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
74   --> $DIR/move-into-closure.rs:44:25
75    |
76 LL |             Either::One(_t)
77    |                         ^^
78
79 error[E0507]: cannot move out of captured variable in an `Fn` closure
80   --> $DIR/move-into-closure.rs:47:15
81    |
82 LL |     let e = Either::One(X(Y));
83    |         - captured outer variable
84 ...
85 LL |         match e {
86    |               ^
87    |               |
88    |               cannot move out of captured variable in an `Fn` closure
89    |               help: consider borrowing here: `&e`
90 ...
91 LL |             Either::One(_t) => (),
92    |                         -- data moved here
93    |
94 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
95   --> $DIR/move-into-closure.rs:51:25
96    |
97 LL |             Either::One(_t) => (),
98    |                         ^^
99
100 error[E0507]: cannot move out of captured variable in an `Fn` closure
101   --> $DIR/move-into-closure.rs:56:25
102    |
103 LL |     let x = X(Y);
104    |         - captured outer variable
105 ...
106 LL |         let X(mut _t) = x;
107    |               ------    ^
108    |               |         |
109    |               |         cannot move out of captured variable in an `Fn` closure
110    |               |         help: consider borrowing here: `&x`
111    |               data moved here
112    |
113 note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
114   --> $DIR/move-into-closure.rs:56:15
115    |
116 LL |         let X(mut _t) = x;
117    |               ^^^^^^
118
119 error[E0507]: cannot move out of captured variable in an `Fn` closure
120   --> $DIR/move-into-closure.rs:60:38
121    |
122 LL |     let mut em = Either::One(X(Y));
123    |         ------ captured outer variable
124 ...
125 LL |         if let Either::One(mut _t) = em { }
126    |                            ------    ^^
127    |                            |         |
128    |                            |         cannot move out of captured variable in an `Fn` closure
129    |                            |         help: consider borrowing here: `&em`
130    |                            data moved here
131    |
132 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
133   --> $DIR/move-into-closure.rs:60:28
134    |
135 LL |         if let Either::One(mut _t) = em { }
136    |                            ^^^^^^
137
138 error[E0507]: cannot move out of captured variable in an `Fn` closure
139   --> $DIR/move-into-closure.rs:64:41
140    |
141 LL |     let mut em = Either::One(X(Y));
142    |         ------ captured outer variable
143 ...
144 LL |         while let Either::One(mut _t) = em { }
145    |                               ------    ^^
146    |                               |         |
147    |                               |         cannot move out of captured variable in an `Fn` closure
148    |                               |         help: consider borrowing here: `&em`
149    |                               data moved here
150    |
151 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
152   --> $DIR/move-into-closure.rs:64:31
153    |
154 LL |         while let Either::One(mut _t) = em { }
155    |                               ^^^^^^
156
157 error[E0507]: cannot move out of captured variable in an `Fn` closure
158   --> $DIR/move-into-closure.rs:68:15
159    |
160 LL |     let mut em = Either::One(X(Y));
161    |         ------ captured outer variable
162 ...
163 LL |         match em {
164    |               ^^
165    |               |
166    |               cannot move out of captured variable in an `Fn` closure
167    |               help: consider borrowing here: `&em`
168 ...
169 LL |             Either::One(mut _t)
170    |                         ------ data moved here
171    |
172 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
173   --> $DIR/move-into-closure.rs:72:25
174    |
175 LL |             Either::One(mut _t)
176    |                         ^^^^^^
177
178 error[E0507]: cannot move out of captured variable in an `Fn` closure
179   --> $DIR/move-into-closure.rs:75:15
180    |
181 LL |     let mut em = Either::One(X(Y));
182    |         ------ captured outer variable
183 ...
184 LL |         match em {
185    |               ^^
186    |               |
187    |               cannot move out of captured variable in an `Fn` closure
188    |               help: consider borrowing here: `&em`
189 ...
190 LL |             Either::One(mut _t) => (),
191    |                         ------ data moved here
192    |
193 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
194   --> $DIR/move-into-closure.rs:79:25
195    |
196 LL |             Either::One(mut _t) => (),
197    |                         ^^^^^^
198
199 error[E0507]: cannot move out of captured variable in an `FnMut` closure
200   --> $DIR/move-into-closure.rs:95:21
201    |
202 LL |     let x = X(Y);
203    |         - captured outer variable
204 ...
205 LL |         let X(_t) = x;
206    |               --    ^
207    |               |     |
208    |               |     cannot move out of captured variable in an `FnMut` closure
209    |               |     help: consider borrowing here: `&x`
210    |               data moved here
211    |
212 note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
213   --> $DIR/move-into-closure.rs:95:15
214    |
215 LL |         let X(_t) = x;
216    |               ^^
217
218 error[E0507]: cannot move out of captured variable in an `FnMut` closure
219   --> $DIR/move-into-closure.rs:99:34
220    |
221 LL |     let e = Either::One(X(Y));
222    |         - captured outer variable
223 ...
224 LL |         if let Either::One(_t) = e { }
225    |                            --    ^
226    |                            |     |
227    |                            |     cannot move out of captured variable in an `FnMut` closure
228    |                            |     help: consider borrowing here: `&e`
229    |                            data moved here
230    |
231 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
232   --> $DIR/move-into-closure.rs:99:28
233    |
234 LL |         if let Either::One(_t) = e { }
235    |                            ^^
236
237 error[E0507]: cannot move out of captured variable in an `FnMut` closure
238   --> $DIR/move-into-closure.rs:103:37
239    |
240 LL |     let e = Either::One(X(Y));
241    |         - captured outer variable
242 ...
243 LL |         while let Either::One(_t) = e { }
244    |                               --    ^
245    |                               |     |
246    |                               |     cannot move out of captured variable in an `FnMut` closure
247    |                               |     help: consider borrowing here: `&e`
248    |                               data moved here
249    |
250 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
251   --> $DIR/move-into-closure.rs:103:31
252    |
253 LL |         while let Either::One(_t) = e { }
254    |                               ^^
255
256 error[E0507]: cannot move out of captured variable in an `FnMut` closure
257   --> $DIR/move-into-closure.rs:107:15
258    |
259 LL |     let e = Either::One(X(Y));
260    |         - captured outer variable
261 ...
262 LL |         match e {
263    |               ^
264    |               |
265    |               cannot move out of captured variable in an `FnMut` closure
266    |               help: consider borrowing here: `&e`
267 ...
268 LL |             Either::One(_t)
269    |                         -- data moved here
270    |
271 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
272   --> $DIR/move-into-closure.rs:111:25
273    |
274 LL |             Either::One(_t)
275    |                         ^^
276
277 error[E0507]: cannot move out of captured variable in an `FnMut` closure
278   --> $DIR/move-into-closure.rs:114:15
279    |
280 LL |     let e = Either::One(X(Y));
281    |         - captured outer variable
282 ...
283 LL |         match e {
284    |               ^
285    |               |
286    |               cannot move out of captured variable in an `FnMut` closure
287    |               help: consider borrowing here: `&e`
288 ...
289 LL |             Either::One(_t) => (),
290    |                         -- data moved here
291    |
292 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
293   --> $DIR/move-into-closure.rs:118:25
294    |
295 LL |             Either::One(_t) => (),
296    |                         ^^
297
298 error[E0507]: cannot move out of captured variable in an `FnMut` closure
299   --> $DIR/move-into-closure.rs:123:25
300    |
301 LL |     let x = X(Y);
302    |         - captured outer variable
303 ...
304 LL |         let X(mut _t) = x;
305    |               ------    ^
306    |               |         |
307    |               |         cannot move out of captured variable in an `FnMut` closure
308    |               |         help: consider borrowing here: `&x`
309    |               data moved here
310    |
311 note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
312   --> $DIR/move-into-closure.rs:123:15
313    |
314 LL |         let X(mut _t) = x;
315    |               ^^^^^^
316
317 error[E0507]: cannot move out of captured variable in an `FnMut` closure
318   --> $DIR/move-into-closure.rs:127:38
319    |
320 LL |     let mut em = Either::One(X(Y));
321    |         ------ captured outer variable
322 ...
323 LL |         if let Either::One(mut _t) = em { }
324    |                            ------    ^^
325    |                            |         |
326    |                            |         cannot move out of captured variable in an `FnMut` closure
327    |                            |         help: consider borrowing here: `&em`
328    |                            data moved here
329    |
330 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
331   --> $DIR/move-into-closure.rs:127:28
332    |
333 LL |         if let Either::One(mut _t) = em { }
334    |                            ^^^^^^
335
336 error[E0507]: cannot move out of captured variable in an `FnMut` closure
337   --> $DIR/move-into-closure.rs:131:41
338    |
339 LL |     let mut em = Either::One(X(Y));
340    |         ------ captured outer variable
341 ...
342 LL |         while let Either::One(mut _t) = em { }
343    |                               ------    ^^
344    |                               |         |
345    |                               |         cannot move out of captured variable in an `FnMut` closure
346    |                               |         help: consider borrowing here: `&em`
347    |                               data moved here
348    |
349 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
350   --> $DIR/move-into-closure.rs:131:31
351    |
352 LL |         while let Either::One(mut _t) = em { }
353    |                               ^^^^^^
354
355 error[E0507]: cannot move out of captured variable in an `FnMut` closure
356   --> $DIR/move-into-closure.rs:135:15
357    |
358 LL |     let mut em = Either::One(X(Y));
359    |         ------ captured outer variable
360 ...
361 LL |         match em {
362    |               ^^
363    |               |
364    |               cannot move out of captured variable in an `FnMut` closure
365    |               help: consider borrowing here: `&em`
366 ...
367 LL |             Either::One(mut _t)
368    |                         ------ data moved here
369    |
370 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
371   --> $DIR/move-into-closure.rs:139:25
372    |
373 LL |             Either::One(mut _t)
374    |                         ^^^^^^
375
376 error[E0507]: cannot move out of captured variable in an `FnMut` closure
377   --> $DIR/move-into-closure.rs:142:15
378    |
379 LL |     let mut em = Either::One(X(Y));
380    |         ------ captured outer variable
381 ...
382 LL |         match em {
383    |               ^^
384    |               |
385    |               cannot move out of captured variable in an `FnMut` closure
386    |               help: consider borrowing here: `&em`
387 ...
388 LL |             Either::One(mut _t) => (),
389    |                         ------ data moved here
390    |
391 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
392   --> $DIR/move-into-closure.rs:146:25
393    |
394 LL |             Either::One(mut _t) => (),
395    |                         ^^^^^^
396
397 error[E0507]: cannot move out of captured variable in an `FnMut` closure
398   --> $DIR/move-into-closure.rs:150:15
399    |
400 LL |     let mut em = Either::One(X(Y));
401    |         ------ captured outer variable
402 ...
403 LL |         match em {
404    |               ^^
405    |               |
406    |               cannot move out of captured variable in an `FnMut` closure
407    |               help: consider borrowing here: `&em`
408 ...
409 LL |             Either::One(mut _t) => (),
410    |                         ------ data moved here
411    |
412 note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
413   --> $DIR/move-into-closure.rs:154:25
414    |
415 LL |             Either::One(mut _t) => (),
416    |                         ^^^^^^
417
418 error: aborting due to 21 previous errors
419
420 For more information about this error, try `rustc --explain E0507`.