fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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