]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr
Update tests for changes to cannot move errors
[rust.git] / src / test / ui / suggestions / dont-suggest-ref / move-into-closure.stderr
1 error[E0507]: cannot move out of `x.0`, as `x` is a 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    |               --    ^ help: consider borrowing here: `&x`
9    |               |
10    |               data moved here
11    |               move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
12
13 error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
14   --> $DIR/move-into-closure.rs:32:34
15    |
16 LL |     let e = Either::One(X(Y));
17    |         - captured outer variable
18 ...
19 LL |         if let Either::One(_t) = e { }
20    |                            --    ^ help: consider borrowing here: `&e`
21    |                            |
22    |                            data moved here
23    |                            move occurs because `_t` has type `X`, which does not implement the `Copy` trait
24
25 error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
26   --> $DIR/move-into-closure.rs:36:37
27    |
28 LL |     let e = Either::One(X(Y));
29    |         - captured outer variable
30 ...
31 LL |         while let Either::One(_t) = e { }
32    |                               --    ^ help: consider borrowing here: `&e`
33    |                               |
34    |                               data moved here
35    |                               move occurs because `_t` has type `X`, which does not implement the `Copy` trait
36
37 error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
38   --> $DIR/move-into-closure.rs:40:15
39    |
40 LL |     let e = Either::One(X(Y));
41    |         - captured outer variable
42 ...
43 LL |         match e {
44    |               ^ help: consider borrowing here: `&e`
45 ...
46 LL |             Either::One(_t)
47    |                         --
48    |                         |
49    |                         data moved here
50    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
51
52 error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
53   --> $DIR/move-into-closure.rs:47:15
54    |
55 LL |     let e = Either::One(X(Y));
56    |         - captured outer variable
57 ...
58 LL |         match e {
59    |               ^ help: consider borrowing here: `&e`
60 ...
61 LL |             Either::One(_t) => (),
62    |                         --
63    |                         |
64    |                         data moved here
65    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
66
67 error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure
68   --> $DIR/move-into-closure.rs:56:25
69    |
70 LL |     let x = X(Y);
71    |         - captured outer variable
72 ...
73 LL |         let X(mut _t) = x;
74    |               ------    ^ help: consider borrowing here: `&x`
75    |               |
76    |               data moved here
77    |               move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
78
79 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
80   --> $DIR/move-into-closure.rs:60:38
81    |
82 LL |     let mut em = Either::One(X(Y));
83    |         ------ captured outer variable
84 ...
85 LL |         if let Either::One(mut _t) = em { }
86    |                            ------    ^^ help: consider borrowing here: `&em`
87    |                            |
88    |                            data moved here
89    |                            move occurs because `_t` has type `X`, which does not implement the `Copy` trait
90
91 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
92   --> $DIR/move-into-closure.rs:64:41
93    |
94 LL |     let mut em = Either::One(X(Y));
95    |         ------ captured outer variable
96 ...
97 LL |         while let Either::One(mut _t) = em { }
98    |                               ------    ^^ help: consider borrowing here: `&em`
99    |                               |
100    |                               data moved here
101    |                               move occurs because `_t` has type `X`, which does not implement the `Copy` trait
102
103 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
104   --> $DIR/move-into-closure.rs:68:15
105    |
106 LL |     let mut em = Either::One(X(Y));
107    |         ------ captured outer variable
108 ...
109 LL |         match em {
110    |               ^^ help: consider borrowing here: `&em`
111 ...
112 LL |             Either::One(mut _t)
113    |                         ------
114    |                         |
115    |                         data moved here
116    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
117
118 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
119   --> $DIR/move-into-closure.rs:75:15
120    |
121 LL |     let mut em = Either::One(X(Y));
122    |         ------ captured outer variable
123 ...
124 LL |         match em {
125    |               ^^ help: consider borrowing here: `&em`
126 ...
127 LL |             Either::One(mut _t) => (),
128    |                         ------
129    |                         |
130    |                         data moved here
131    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
132
133 error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `FnMut` closure
134   --> $DIR/move-into-closure.rs:95:21
135    |
136 LL |     let x = X(Y);
137    |         - captured outer variable
138 ...
139 LL |         let X(_t) = x;
140    |               --    ^ help: consider borrowing here: `&x`
141    |               |
142    |               data moved here
143    |               move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
144
145 error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
146   --> $DIR/move-into-closure.rs:99:34
147    |
148 LL |     let e = Either::One(X(Y));
149    |         - captured outer variable
150 ...
151 LL |         if let Either::One(_t) = e { }
152    |                            --    ^ help: consider borrowing here: `&e`
153    |                            |
154    |                            data moved here
155    |                            move occurs because `_t` has type `X`, which does not implement the `Copy` trait
156
157 error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
158   --> $DIR/move-into-closure.rs:103:37
159    |
160 LL |     let e = Either::One(X(Y));
161    |         - captured outer variable
162 ...
163 LL |         while let Either::One(_t) = e { }
164    |                               --    ^ help: consider borrowing here: `&e`
165    |                               |
166    |                               data moved here
167    |                               move occurs because `_t` has type `X`, which does not implement the `Copy` trait
168
169 error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
170   --> $DIR/move-into-closure.rs:107:15
171    |
172 LL |     let e = Either::One(X(Y));
173    |         - captured outer variable
174 ...
175 LL |         match e {
176    |               ^ help: consider borrowing here: `&e`
177 ...
178 LL |             Either::One(_t)
179    |                         --
180    |                         |
181    |                         data moved here
182    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
183
184 error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
185   --> $DIR/move-into-closure.rs:114:15
186    |
187 LL |     let e = Either::One(X(Y));
188    |         - captured outer variable
189 ...
190 LL |         match e {
191    |               ^ help: consider borrowing here: `&e`
192 ...
193 LL |             Either::One(_t) => (),
194    |                         --
195    |                         |
196    |                         data moved here
197    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
198
199 error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `FnMut` closure
200   --> $DIR/move-into-closure.rs:123:25
201    |
202 LL |     let x = X(Y);
203    |         - captured outer variable
204 ...
205 LL |         let X(mut _t) = x;
206    |               ------    ^ help: consider borrowing here: `&x`
207    |               |
208    |               data moved here
209    |               move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
210
211 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
212   --> $DIR/move-into-closure.rs:127:38
213    |
214 LL |     let mut em = Either::One(X(Y));
215    |         ------ captured outer variable
216 ...
217 LL |         if let Either::One(mut _t) = em { }
218    |                            ------    ^^ help: consider borrowing here: `&em`
219    |                            |
220    |                            data moved here
221    |                            move occurs because `_t` has type `X`, which does not implement the `Copy` trait
222
223 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
224   --> $DIR/move-into-closure.rs:131:41
225    |
226 LL |     let mut em = Either::One(X(Y));
227    |         ------ captured outer variable
228 ...
229 LL |         while let Either::One(mut _t) = em { }
230    |                               ------    ^^ help: consider borrowing here: `&em`
231    |                               |
232    |                               data moved here
233    |                               move occurs because `_t` has type `X`, which does not implement the `Copy` trait
234
235 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
236   --> $DIR/move-into-closure.rs:135:15
237    |
238 LL |     let mut em = Either::One(X(Y));
239    |         ------ captured outer variable
240 ...
241 LL |         match em {
242    |               ^^ help: consider borrowing here: `&em`
243 ...
244 LL |             Either::One(mut _t)
245    |                         ------
246    |                         |
247    |                         data moved here
248    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
249
250 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
251   --> $DIR/move-into-closure.rs:142:15
252    |
253 LL |     let mut em = Either::One(X(Y));
254    |         ------ captured outer variable
255 ...
256 LL |         match em {
257    |               ^^ help: consider borrowing here: `&em`
258 ...
259 LL |             Either::One(mut _t) => (),
260    |                         ------
261    |                         |
262    |                         data moved here
263    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
264
265 error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
266   --> $DIR/move-into-closure.rs:150:15
267    |
268 LL |     let mut em = Either::One(X(Y));
269    |         ------ captured outer variable
270 ...
271 LL |         match em {
272    |               ^^ help: consider borrowing here: `&em`
273 ...
274 LL |             Either::One(mut _t) => (),
275    |                         ------
276    |                         |
277    |                         data moved here
278    |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
279
280 error: aborting due to 21 previous errors
281
282 For more information about this error, try `rustc --explain E0507`.