1
- error[E0507 ]: cannot move out of a shared reference
1
+ error[E0508 ]: cannot move out of type `[Struct]`, a non-copy slice
2
2
--> $DIR/cant_move_out_of_pattern.rs:9:11
3
3
|
4
4
LL | match b {
5
- | ^
5
+ | ^ cannot move out of here
6
6
LL |
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
12
12
|
13
13
help: consider borrowing the pattern binding
14
14
|
15
- LL | deref!(ref x) => x,
16
- | +++
15
+ LL | deref!([ ref x] ) => x,
16
+ | +++
17
17
18
18
error[E0507]: cannot move out of a shared reference
19
19
--> $DIR/cant_move_out_of_pattern.rs:17:11
@@ -32,22 +32,22 @@ help: consider borrowing the pattern binding
32
32
LL | deref!(ref x) => x,
33
33
| +++
34
34
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
37
37
|
38
38
LL | match b {
39
- | ^
39
+ | ^ cannot move out of here
40
40
LL |
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
46
46
|
47
47
help: consider borrowing the pattern binding
48
48
|
49
- LL | Container( ref x) => x,
50
- | +++
49
+ LL | [ ref x] => x,
50
+ | +++
51
51
52
52
error[E0507]: cannot move out of a shared reference
53
53
--> $DIR/cant_move_out_of_pattern.rs:35:11
@@ -68,4 +68,5 @@ LL | Container(ref x) => x,
68
68
69
69
error: aborting due to 4 previous errors
70
70
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