1 error[E0507]: cannot move out of `s` which is behind a shared reference
2 --> $DIR/simple.rs:38:17
8 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
10 help: consider removing the dereference here
16 error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference
17 --> $DIR/simple.rs:41:30
19 LL | if let Either::One(_t) = *r { }
23 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
25 help: consider removing the dereference here
27 LL - if let Either::One(_t) = *r { }
28 LL + if let Either::One(_t) = r { }
31 error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference
32 --> $DIR/simple.rs:44:33
34 LL | while let Either::One(_t) = *r { }
38 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
40 help: consider removing the dereference here
42 LL - while let Either::One(_t) = *r { }
43 LL + while let Either::One(_t) = r { }
46 error[E0507]: cannot move out of `r` as enum variant `Two` which is behind a shared reference
47 --> $DIR/simple.rs:47:11
56 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
58 help: consider removing the dereference here
64 error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference
65 --> $DIR/simple.rs:53:11
70 LL | Either::One(_t) => (),
74 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
76 help: consider removing the dereference here
82 error[E0507]: cannot move out of `sm` which is behind a mutable reference
83 --> $DIR/simple.rs:61:17
89 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
91 help: consider removing the dereference here
97 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
98 --> $DIR/simple.rs:64:30
100 LL | if let Either::One(_t) = *rm { }
104 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
106 help: consider removing the dereference here
108 LL - if let Either::One(_t) = *rm { }
109 LL + if let Either::One(_t) = rm { }
112 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
113 --> $DIR/simple.rs:67:33
115 LL | while let Either::One(_t) = *rm { }
119 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
121 help: consider removing the dereference here
123 LL - while let Either::One(_t) = *rm { }
124 LL + while let Either::One(_t) = rm { }
127 error[E0507]: cannot move out of `rm` as enum variant `Two` which is behind a mutable reference
128 --> $DIR/simple.rs:70:11
137 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
139 help: consider removing the dereference here
145 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
146 --> $DIR/simple.rs:76:11
151 LL | Either::One(_t) => (),
155 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
157 help: consider removing the dereference here
163 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
164 --> $DIR/simple.rs:83:11
169 LL | Either::One(_t) => (),
173 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
175 help: consider removing the dereference here
181 error[E0507]: cannot move out of index of `Vec<X>`
182 --> $DIR/simple.rs:91:17
184 LL | let X(_t) = vs[0];
188 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
190 help: consider borrowing here
192 LL | let X(_t) = &vs[0];
195 error[E0507]: cannot move out of index of `Vec<Either>`
196 --> $DIR/simple.rs:94:30
198 LL | if let Either::One(_t) = vr[0] { }
202 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
204 help: consider borrowing here
206 LL | if let Either::One(_t) = &vr[0] { }
209 error[E0507]: cannot move out of index of `Vec<Either>`
210 --> $DIR/simple.rs:97:33
212 LL | while let Either::One(_t) = vr[0] { }
216 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
218 help: consider borrowing here
220 LL | while let Either::One(_t) = &vr[0] { }
223 error[E0507]: cannot move out of index of `Vec<Either>`
224 --> $DIR/simple.rs:100:11
233 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
235 help: consider borrowing here
240 error[E0507]: cannot move out of index of `Vec<Either>`
241 --> $DIR/simple.rs:106:11
246 LL | Either::One(_t) => (),
250 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
252 help: consider borrowing here
257 error[E0507]: cannot move out of index of `Vec<X>`
258 --> $DIR/simple.rs:114:17
260 LL | let X(_t) = vsm[0];
264 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
266 help: consider borrowing here
268 LL | let X(_t) = &vsm[0];
271 error[E0507]: cannot move out of index of `Vec<Either>`
272 --> $DIR/simple.rs:117:30
274 LL | if let Either::One(_t) = vrm[0] { }
278 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
280 help: consider borrowing here
282 LL | if let Either::One(_t) = &vrm[0] { }
285 error[E0507]: cannot move out of index of `Vec<Either>`
286 --> $DIR/simple.rs:120:33
288 LL | while let Either::One(_t) = vrm[0] { }
292 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
294 help: consider borrowing here
296 LL | while let Either::One(_t) = &vrm[0] { }
299 error[E0507]: cannot move out of index of `Vec<Either>`
300 --> $DIR/simple.rs:123:11
309 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
311 help: consider borrowing here
316 error[E0507]: cannot move out of index of `Vec<Either>`
317 --> $DIR/simple.rs:129:11
322 LL | Either::One(_t) => (),
326 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
328 help: consider borrowing here
333 error[E0507]: cannot move out of index of `Vec<Either>`
334 --> $DIR/simple.rs:136:11
339 LL | Either::One(_t) => (),
343 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
345 help: consider borrowing here
350 error[E0507]: cannot move out of `s` which is behind a shared reference
351 --> $DIR/simple.rs:146:18
357 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
359 help: consider removing the borrow
365 error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference
366 --> $DIR/simple.rs:149:31
368 LL | if let &Either::One(_t) = r { }
372 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
374 help: consider removing the borrow
376 LL - if let &Either::One(_t) = r { }
377 LL + if let Either::One(_t) = r { }
380 error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference
381 --> $DIR/simple.rs:152:34
383 LL | while let &Either::One(_t) = r { }
387 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
389 help: consider removing the borrow
391 LL - while let &Either::One(_t) = r { }
392 LL + while let Either::One(_t) = r { }
395 error[E0507]: cannot move out of `r` as enum variant `Two` which is behind a shared reference
396 --> $DIR/simple.rs:155:11
401 LL | &Either::One(_t)
405 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
407 help: consider removing the borrow
409 LL - &Either::One(_t)
413 error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference
414 --> $DIR/simple.rs:162:11
419 LL | &Either::One(_t) => (),
423 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
425 help: consider removing the borrow
427 LL - &Either::One(_t) => (),
428 LL + Either::One(_t) => (),
431 error[E0507]: cannot move out of `r` as enum variant `One` which is behind a shared reference
432 --> $DIR/simple.rs:168:11
437 LL | &Either::One(_t) => (),
441 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
443 help: consider removing the borrow
445 LL - &Either::One(_t) => (),
446 LL + Either::One(_t) => (),
449 error[E0507]: cannot move out of `sm` which is behind a mutable reference
450 --> $DIR/simple.rs:178:22
452 LL | let &mut X(_t) = sm;
456 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
458 help: consider removing the mutable borrow
460 LL - let &mut X(_t) = sm;
464 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
465 --> $DIR/simple.rs:181:35
467 LL | if let &mut Either::One(_t) = rm { }
471 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
473 help: consider removing the mutable borrow
475 LL - if let &mut Either::One(_t) = rm { }
476 LL + if let Either::One(_t) = rm { }
479 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
480 --> $DIR/simple.rs:184:38
482 LL | while let &mut Either::One(_t) = rm { }
486 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
488 help: consider removing the mutable borrow
490 LL - while let &mut Either::One(_t) = rm { }
491 LL + while let Either::One(_t) = rm { }
494 error[E0507]: cannot move out of `rm` as enum variant `Two` which is behind a mutable reference
495 --> $DIR/simple.rs:187:11
500 LL | &mut Either::One(_t) => (),
503 LL | &mut Either::Two(_t) => (),
506 = note: move occurs because these variables have types that don't implement the `Copy` trait
507 help: consider removing the mutable borrow
509 LL - &mut Either::One(_t) => (),
510 LL + Either::One(_t) => (),
512 help: consider removing the mutable borrow
514 LL - &mut Either::Two(_t) => (),
515 LL + Either::Two(_t) => (),
518 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
519 --> $DIR/simple.rs:194:11
524 LL | &mut Either::One(_t) => (),
528 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
530 help: consider removing the mutable borrow
532 LL - &mut Either::One(_t) => (),
533 LL + Either::One(_t) => (),
536 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
537 --> $DIR/simple.rs:200:11
542 LL | &mut Either::One(_t) => (),
546 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
548 help: consider removing the mutable borrow
550 LL - &mut Either::One(_t) => (),
551 LL + Either::One(_t) => (),
554 error[E0507]: cannot move out of `rm` as enum variant `One` which is behind a mutable reference
555 --> $DIR/simple.rs:206:11
560 LL | &mut Either::One(_t) => (),
564 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
566 help: consider removing the mutable borrow
568 LL - &mut Either::One(_t) => (),
569 LL + Either::One(_t) => (),
572 error[E0507]: cannot move out of a shared reference
573 --> $DIR/simple.rs:220:21
575 LL | let (&X(_t),) = (&x.clone(),);
579 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
581 help: consider borrowing the pattern binding
583 LL | let (&X(ref _t),) = (&x.clone(),);
586 error[E0507]: cannot move out of a shared reference
587 --> $DIR/simple.rs:223:34
589 LL | if let (&Either::One(_t),) = (&e.clone(),) { }
593 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
595 help: consider borrowing the pattern binding
597 LL | if let (&Either::One(ref _t),) = (&e.clone(),) { }
600 error[E0507]: cannot move out of a shared reference
601 --> $DIR/simple.rs:226:37
603 LL | while let (&Either::One(_t),) = (&e.clone(),) { }
607 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
609 help: consider borrowing the pattern binding
611 LL | while let (&Either::One(ref _t),) = (&e.clone(),) { }
614 error[E0507]: cannot move out of a shared reference
615 --> $DIR/simple.rs:229:11
617 LL | match (&e.clone(),) {
620 LL | (&Either::One(_t),)
624 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
626 help: consider borrowing the pattern binding
628 LL | (&Either::One(ref _t),)
631 error[E0507]: cannot move out of a mutable reference
632 --> $DIR/simple.rs:239:25
634 LL | let (&mut X(_t),) = (&mut xm.clone(),);
635 | -- ^^^^^^^^^^^^^^^^^^
638 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
640 help: consider borrowing the pattern binding
642 LL | let (&mut X(ref _t),) = (&mut xm.clone(),);
645 error[E0507]: cannot move out of a mutable reference
646 --> $DIR/simple.rs:242:38
648 LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { }
649 | -- ^^^^^^^^^^^^^^^^^^
652 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
654 help: consider borrowing the pattern binding
656 LL | if let (&mut Either::One(ref _t),) = (&mut em.clone(),) { }
659 error[E0507]: cannot move out of a mutable reference
660 --> $DIR/simple.rs:245:41
662 LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { }
663 | -- ^^^^^^^^^^^^^^^^^^
666 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
668 help: consider borrowing the pattern binding
670 LL | while let (&mut Either::One(ref _t),) = (&mut em.clone(),) { }
673 error[E0507]: cannot move out of a mutable reference
674 --> $DIR/simple.rs:248:11
676 LL | match (&mut em.clone(),) {
679 LL | (&mut Either::One(_t),) => (),
682 LL | (&mut Either::Two(_t),) => (),
685 = note: move occurs because these variables have types that don't implement the `Copy` trait
686 help: consider borrowing the pattern binding
688 LL | (&mut Either::One(ref _t),) => (),
690 help: consider borrowing the pattern binding
692 LL | (&mut Either::Two(ref _t),) => (),
695 error[E0507]: cannot move out of a shared reference
696 --> $DIR/simple.rs:261:18
698 LL | let &X(_t) = &x;
702 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
704 help: consider removing the borrow
706 LL - let &X(_t) = &x;
710 error[E0507]: cannot move out of a shared reference
711 --> $DIR/simple.rs:264:31
713 LL | if let &Either::One(_t) = &e { }
717 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
719 help: consider removing the borrow
721 LL - if let &Either::One(_t) = &e { }
722 LL + if let Either::One(_t) = &e { }
725 error[E0507]: cannot move out of a shared reference
726 --> $DIR/simple.rs:267:34
728 LL | while let &Either::One(_t) = &e { }
732 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
734 help: consider removing the borrow
736 LL - while let &Either::One(_t) = &e { }
737 LL + while let Either::One(_t) = &e { }
740 error[E0507]: cannot move out of a shared reference
741 --> $DIR/simple.rs:270:11
746 LL | &Either::One(_t)
750 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
752 help: consider removing the borrow
754 LL - &Either::One(_t)
758 error[E0507]: cannot move out of a shared reference
759 --> $DIR/simple.rs:277:11
764 LL | &Either::One(_t) => (),
768 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
770 help: consider removing the borrow
772 LL - &Either::One(_t) => (),
773 LL + Either::One(_t) => (),
776 error[E0507]: cannot move out of a shared reference
777 --> $DIR/simple.rs:283:11
782 LL | &Either::One(_t) => (),
786 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
788 help: consider removing the borrow
790 LL - &Either::One(_t) => (),
791 LL + Either::One(_t) => (),
794 error[E0507]: cannot move out of a mutable reference
795 --> $DIR/simple.rs:290:22
797 LL | let &mut X(_t) = &mut xm;
801 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
803 help: consider removing the mutable borrow
805 LL - let &mut X(_t) = &mut xm;
806 LL + let X(_t) = &mut xm;
809 error[E0507]: cannot move out of a mutable reference
810 --> $DIR/simple.rs:293:35
812 LL | if let &mut Either::One(_t) = &mut em { }
816 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
818 help: consider removing the mutable borrow
820 LL - if let &mut Either::One(_t) = &mut em { }
821 LL + if let Either::One(_t) = &mut em { }
824 error[E0507]: cannot move out of a mutable reference
825 --> $DIR/simple.rs:296:38
827 LL | while let &mut Either::One(_t) = &mut em { }
831 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
833 help: consider removing the mutable borrow
835 LL - while let &mut Either::One(_t) = &mut em { }
836 LL + while let Either::One(_t) = &mut em { }
839 error[E0507]: cannot move out of a mutable reference
840 --> $DIR/simple.rs:299:11
845 LL | &mut Either::One(_t)
849 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
851 help: consider removing the mutable borrow
853 LL - &mut Either::One(_t)
857 error[E0507]: cannot move out of a mutable reference
858 --> $DIR/simple.rs:306:11
863 LL | &mut Either::One(_t) => (),
867 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
869 help: consider removing the mutable borrow
871 LL - &mut Either::One(_t) => (),
872 LL + Either::One(_t) => (),
875 error[E0507]: cannot move out of a mutable reference
876 --> $DIR/simple.rs:312:11
881 LL | &mut Either::One(_t) => (),
885 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
887 help: consider removing the mutable borrow
889 LL - &mut Either::One(_t) => (),
890 LL + Either::One(_t) => (),
893 error[E0507]: cannot move out of a mutable reference
894 --> $DIR/simple.rs:318:11
899 LL | &mut Either::One(_t) => (),
903 | move occurs because `_t` has type `X`, which does not implement the `Copy` trait
905 help: consider removing the mutable borrow
907 LL - &mut Either::One(_t) => (),
908 LL + Either::One(_t) => (),
911 error[E0507]: cannot move out of a shared reference
912 --> $DIR/simple.rs:174:11
914 LL | fn f1(&X(_t): &X) { }
918 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
920 help: consider removing the borrow
922 LL - fn f1(&X(_t): &X) { }
923 LL + fn f1(X(_t): &X) { }
926 error[E0507]: cannot move out of a mutable reference
927 --> $DIR/simple.rs:212:11
929 LL | fn f2(&mut X(_t): &mut X) { }
933 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
935 help: consider removing the mutable borrow
937 LL - fn f2(&mut X(_t): &mut X) { }
938 LL + fn f2(X(_t): &mut X) { }
941 error[E0507]: cannot move out of a shared reference
942 --> $DIR/simple.rs:235:11
944 LL | fn f3((&X(_t),): (&X,)) { }
948 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
950 help: consider borrowing the pattern binding
952 LL | fn f3((&X(ref _t),): (&X,)) { }
955 error[E0507]: cannot move out of a mutable reference
956 --> $DIR/simple.rs:255:11
958 LL | fn f4((&mut X(_t),): (&mut X,)) { }
962 | move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
964 help: consider borrowing the pattern binding
966 LL | fn f4((&mut X(ref _t),): (&mut X,)) { }
969 error[E0507]: cannot move out of `a.a` as enum variant `Some` which is behind a shared reference
970 --> $DIR/simple.rs:331:20
972 LL | let Some(_s) = a.a else {
976 | move occurs because `_s` has type `String`, which does not implement the `Copy` trait
978 help: consider borrowing the pattern binding
980 LL | let Some(ref _s) = a.a else {
983 error: aborting due to 61 previous errors
985 For more information about this error, try `rustc --explain E0507`.