error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:47:17 | LL | let X(_t) = *s; | -- ^^ | | | | | cannot move out of borrowed content | | help: consider removing the `*`: `s` | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:47:11 | LL | let X(_t) = *s; | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:51:30 | LL | if let Either::One(_t) = *r { } | -- ^^ | | | | | cannot move out of borrowed content | | help: consider removing the `*`: `r` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:51:24 | LL | if let Either::One(_t) = *r { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:55:33 | LL | while let Either::One(_t) = *r { } | -- ^^ | | | | | cannot move out of borrowed content | | help: consider removing the `*`: `r` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:55:27 | LL | while let Either::One(_t) = *r { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:59:11 | LL | match *r { | ^^ | | | cannot move out of borrowed content | help: consider removing the `*`: `r` ... LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:63:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:66:11 | LL | match *r { | ^^ | | | cannot move out of borrowed content | help: consider removing the `*`: `r` ... LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:70:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:75:17 | LL | let X(_t) = *sm; | -- ^^^ | | | | | cannot move out of borrowed content | | help: consider removing the `*`: `sm` | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:75:11 | LL | let X(_t) = *sm; | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:79:30 | LL | if let Either::One(_t) = *rm { } | -- ^^^ | | | | | cannot move out of borrowed content | | help: consider removing the `*`: `rm` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:79:24 | LL | if let Either::One(_t) = *rm { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:83:33 | LL | while let Either::One(_t) = *rm { } | -- ^^^ | | | | | cannot move out of borrowed content | | help: consider removing the `*`: `rm` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:83:27 | LL | while let Either::One(_t) = *rm { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:87:11 | LL | match *rm { | ^^^ | | | cannot move out of borrowed content | help: consider removing the `*`: `rm` ... LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:91:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:94:11 | LL | match *rm { | ^^^ | | | cannot move out of borrowed content | help: consider removing the `*`: `rm` ... LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:98:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:102:11 | LL | match *rm { | ^^^ | | | cannot move out of borrowed content | help: consider removing the `*`: `rm` ... LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:106:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:111:17 | LL | let X(_t) = vs_[0]; | -- ^^^^^^ | | | | | cannot move out of borrowed content | | help: consider borrowing here: `&vs_[0]` | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:111:11 | LL | let X(_t) = vs_[0]; | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:115:30 | LL | if let Either::One(_t) = vr[0] { } | -- ^^^^^ | | | | | cannot move out of borrowed content | | help: consider borrowing here: `&vr[0]` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:115:24 | LL | if let Either::One(_t) = vr[0] { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:119:33 | LL | while let Either::One(_t) = vr[0] { } | -- ^^^^^ | | | | | cannot move out of borrowed content | | help: consider borrowing here: `&vr[0]` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:119:27 | LL | while let Either::One(_t) = vr[0] { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:123:11 | LL | match vr[0] { | ^^^^^ | | | cannot move out of borrowed content | help: consider borrowing here: `&vr[0]` ... LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:127:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:130:11 | LL | match vr[0] { | ^^^^^ | | | cannot move out of borrowed content | help: consider borrowing here: `&vr[0]` ... LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:134:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:139:17 | LL | let X(_t) = vsm[0]; | -- ^^^^^^ | | | | | cannot move out of borrowed content | | help: consider borrowing here: `&vsm[0]` | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:139:11 | LL | let X(_t) = vsm[0]; | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:143:30 | LL | if let Either::One(_t) = vrm[0] { } | -- ^^^^^^ | | | | | cannot move out of borrowed content | | help: consider borrowing here: `&vrm[0]` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:143:24 | LL | if let Either::One(_t) = vrm[0] { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:147:33 | LL | while let Either::One(_t) = vrm[0] { } | -- ^^^^^^ | | | | | cannot move out of borrowed content | | help: consider borrowing here: `&vrm[0]` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:147:27 | LL | while let Either::One(_t) = vrm[0] { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:151:11 | LL | match vrm[0] { | ^^^^^^ | | | cannot move out of borrowed content | help: consider borrowing here: `&vrm[0]` ... LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:155:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:158:11 | LL | match vrm[0] { | ^^^^^^ | | | cannot move out of borrowed content | help: consider borrowing here: `&vrm[0]` ... LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:162:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:166:11 | LL | match vrm[0] { | ^^^^^^ | | | cannot move out of borrowed content | help: consider borrowing here: `&vrm[0]` ... LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:170:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:177:18 | LL | let &X(_t) = s; | ------ ^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:177:12 | LL | let &X(_t) = s; | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:181:31 | LL | if let &Either::One(_t) = r { } | ---------------- ^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:181:25 | LL | if let &Either::One(_t) = r { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:185:34 | LL | while let &Either::One(_t) = r { } | ---------------- ^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:185:28 | LL | while let &Either::One(_t) = r { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:189:11 | LL | match r { | ^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &Either::One(_t) | ---------------- | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:191:22 | LL | &Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:197:11 | LL | match r { | ^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &Either::One(_t) => (), | ---------------- | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:199:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:204:11 | LL | match r { | ^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &Either::One(_t) => (), | ---------------- | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:206:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:216:22 | LL | let &mut X(_t) = sm; | ---------- ^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:216:16 | LL | let &mut X(_t) = sm; | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:220:35 | LL | if let &mut Either::One(_t) = rm { } | -------------------- ^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:220:29 | LL | if let &mut Either::One(_t) = rm { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:224:38 | LL | while let &mut Either::One(_t) = rm { } | -------------------- ^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:224:32 | LL | while let &mut Either::One(_t) = rm { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:228:11 | LL | match rm { | ^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &mut Either::One(_t) => (), | -- data moved here ... LL | &mut Either::Two(_t) => (), | -- ... and here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:230:26 | LL | &mut Either::One(_t) => (), | ^^ note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:233:26 | LL | &mut Either::Two(_t) => (), | ^^ help: consider removing the `&mut` | LL | Either::One(_t) => (), | ^^^^^^^^^^^^^^^ help: consider removing the `&mut` | LL | Either::Two(_t) => (), | ^^^^^^^^^^^^^^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:237:11 | LL | match rm { | ^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:239:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:244:11 | LL | match rm { | ^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:246:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:251:11 | LL | match rm { | ^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:253:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:265:18 | LL | let &X(_t) = &x; | ------ ^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:265:12 | LL | let &X(_t) = &x; | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:269:31 | LL | if let &Either::One(_t) = &e { } | ---------------- ^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:269:25 | LL | if let &Either::One(_t) = &e { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:273:34 | LL | while let &Either::One(_t) = &e { } | ---------------- ^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:273:28 | LL | while let &Either::One(_t) = &e { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:277:11 | LL | match &e { | ^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &Either::One(_t) | ---------------- | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:279:22 | LL | &Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:285:11 | LL | match &e { | ^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &Either::One(_t) => (), | ---------------- | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:287:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:292:11 | LL | match &e { | ^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &Either::One(_t) => (), | ---------------- | | | | | data moved here | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:294:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:300:22 | LL | let &mut X(_t) = &mut xm; | ---------- ^^^^^^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:300:16 | LL | let &mut X(_t) = &mut xm; | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:304:35 | LL | if let &mut Either::One(_t) = &mut em { } | -------------------- ^^^^^^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:304:29 | LL | if let &mut Either::One(_t) = &mut em { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:308:38 | LL | while let &mut Either::One(_t) = &mut em { } | -------------------- ^^^^^^^ cannot move out of borrowed content | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:308:32 | LL | while let &mut Either::One(_t) = &mut em { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:312:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &mut Either::One(_t) | -------------------- | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:314:26 | LL | &mut Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:320:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:322:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:327:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:329:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:334:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content LL | //~^ ERROR cannot move LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:336:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:211:11 | LL | fn f1(&X(_t): &X) { } | ^^^--^ | | | | | data moved here | cannot move out of borrowed content | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:211:14 | LL | fn f1(&X(_t): &X) { } | ^^ error[E0507]: cannot move out of borrowed content --> $DIR/dont-suggest-ref.rs:258:11 | LL | fn f2(&mut X(_t): &mut X) { } | ^^^^^^^--^ | | | | | data moved here | cannot move out of borrowed content | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait --> $DIR/dont-suggest-ref.rs:258:18 | LL | fn f2(&mut X(_t): &mut X) { } | ^^ error: aborting due to 50 previous errors For more information about this error, try `rustc --explain E0507`.