1- error[E0507 ]: cannot move out of a shared reference
1+ error[E0508 ]: cannot move out of type `[Struct]`, a non-copy slice
22 --> $DIR/cant_move_out_of_pattern.rs:9:11
33 |
44LL | match b {
5- | ^
5+ | ^ cannot move out of here
66LL |
7- LL | deref!(x ) => x,
8- | -
9- | |
10- | data moved here
11- | move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
7+ LL | deref!([x] ) => x,
8+ | -
9+ | |
10+ | data moved here
11+ | move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
1212 |
1313help: consider borrowing the pattern binding
1414 |
15- LL | deref!(ref x) => x,
16- | +++
15+ LL | deref!([ ref x] ) => x,
16+ | +++
1717
1818error[E0507]: cannot move out of a shared reference
1919 --> $DIR/cant_move_out_of_pattern.rs:17:11
@@ -32,22 +32,22 @@ help: consider borrowing the pattern binding
3232LL | deref!(ref x) => x,
3333 | +++
3434
35- error[E0507 ]: cannot move out of a shared reference
36- --> $DIR/cant_move_out_of_pattern.rs:27 :11
35+ error[E0508 ]: cannot move out of type `[Struct]`, a non-copy slice
36+ --> $DIR/cant_move_out_of_pattern.rs:25 :11
3737 |
3838LL | match b {
39- | ^
39+ | ^ cannot move out of here
4040LL |
41- LL | Container(x) => x,
42- | -
43- | |
44- | data moved here
45- | move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
41+ LL | [x] => x,
42+ | -
43+ | |
44+ | data moved here
45+ | move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
4646 |
4747help: consider borrowing the pattern binding
4848 |
49- LL | Container( ref x) => x,
50- | +++
49+ LL | [ ref x] => x,
50+ | +++
5151
5252error[E0507]: cannot move out of a shared reference
5353 --> $DIR/cant_move_out_of_pattern.rs:35:11
@@ -68,4 +68,5 @@ LL | Container(ref x) => x,
6868
6969error: aborting due to 4 previous errors
7070
71- For more information about this error, try `rustc --explain E0507`.
71+ Some errors have detailed explanations: E0507, E0508.
72+ For more information about an error, try `rustc --explain E0507`.
0 commit comments