fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
11.1 KiB282 linesraw
1error[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   |
4LL |     let x = X(Y);
5   |         - captured outer variable
6...
7LL |         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
13error[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   |
16LL |     let e = Either::One(X(Y));
17   |         - captured outer variable
18...
19LL |         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
25error[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   |
28LL |     let e = Either::One(X(Y));
29   |         - captured outer variable
30...
31LL |         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
37error[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   |
40LL |     let e = Either::One(X(Y));
41   |         - captured outer variable
42...
43LL |         match e {
44   |               ^ help: consider borrowing here: `&e`
45...
46LL |             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
52error[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   |
55LL |     let e = Either::One(X(Y));
56   |         - captured outer variable
57...
58LL |         match e {
59   |               ^ help: consider borrowing here: `&e`
60...
61LL |             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
67error[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   |
70LL |     let x = X(Y);
71   |         - captured outer variable
72...
73LL |         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
79error[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   |
82LL |     let mut em = Either::One(X(Y));
83   |         ------ captured outer variable
84...
85LL |         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
91error[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   |
94LL |     let mut em = Either::One(X(Y));
95   |         ------ captured outer variable
96...
97LL |         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
103error[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   |
106LL |     let mut em = Either::One(X(Y));
107   |         ------ captured outer variable
108...
109LL |         match em {
110   |               ^^ help: consider borrowing here: `&em`
111...
112LL |             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
118error[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   |
121LL |     let mut em = Either::One(X(Y));
122   |         ------ captured outer variable
123...
124LL |         match em {
125   |               ^^ help: consider borrowing here: `&em`
126...
127LL |             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
133error[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   |
136LL |     let x = X(Y);
137   |         - captured outer variable
138...
139LL |         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
145error[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   |
148LL |     let e = Either::One(X(Y));
149   |         - captured outer variable
150...
151LL |         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
157error[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   |
160LL |     let e = Either::One(X(Y));
161   |         - captured outer variable
162...
163LL |         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
169error[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   |
172LL |     let e = Either::One(X(Y));
173   |         - captured outer variable
174...
175LL |         match e {
176   |               ^ help: consider borrowing here: `&e`
177...
178LL |             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
184error[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   |
187LL |     let e = Either::One(X(Y));
188   |         - captured outer variable
189...
190LL |         match e {
191   |               ^ help: consider borrowing here: `&e`
192...
193LL |             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
199error[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   |
202LL |     let x = X(Y);
203   |         - captured outer variable
204...
205LL |         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
211error[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   |
214LL |     let mut em = Either::One(X(Y));
215   |         ------ captured outer variable
216...
217LL |         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
223error[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   |
226LL |     let mut em = Either::One(X(Y));
227   |         ------ captured outer variable
228...
229LL |         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
235error[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   |
238LL |     let mut em = Either::One(X(Y));
239   |         ------ captured outer variable
240...
241LL |         match em {
242   |               ^^ help: consider borrowing here: `&em`
243...
244LL |             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
250error[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   |
253LL |     let mut em = Either::One(X(Y));
254   |         ------ captured outer variable
255...
256LL |         match em {
257   |               ^^ help: consider borrowing here: `&em`
258...
259LL |             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
265error[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   |
268LL |     let mut em = Either::One(X(Y));
269   |         ------ captured outer variable
270...
271LL |         match em {
272   |               ^^ help: consider borrowing here: `&em`
273...
274LL |             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
280error: aborting due to 21 previous errors
281
282For more information about this error, try `rustc --explain E0507`.