about summary refs log tree commit diff
path: root/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.stderr
blob: a548ac5909a8ca45071202a518f3b8abe5e2b4f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
error[E0508]: cannot move out of type `[Struct]`, a non-copy slice
  --> $DIR/cant_move_out_of_pattern.rs:9:11
   |
LL |     match b {
   |           ^ cannot move out of here
LL |
LL |         deref!([x]) => x,
   |                 -
   |                 |
   |                 data moved here
   |                 move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
   |
help: consider borrowing the pattern binding
   |
LL |         deref!([ref x]) => x,
   |                 +++

error[E0507]: cannot move out of a shared reference
  --> $DIR/cant_move_out_of_pattern.rs:17:11
   |
LL |     match rc {
   |           ^^
LL |
LL |         deref!(x) => x,
   |                -
   |                |
   |                data moved here
   |                move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
   |
help: consider borrowing the pattern binding
   |
LL |         deref!(ref x) => x,
   |                +++

error[E0508]: cannot move out of type `[Struct]`, a non-copy slice
  --> $DIR/cant_move_out_of_pattern.rs:25:11
   |
LL |     match b {
   |           ^ cannot move out of here
LL |
LL |         [x] => x,
   |          -
   |          |
   |          data moved here
   |          move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
   |
help: consider borrowing the pattern binding
   |
LL |         [ref x] => x,
   |          +++

error[E0507]: cannot move out of a shared reference
  --> $DIR/cant_move_out_of_pattern.rs:35:11
   |
LL |     match rc {
   |           ^^
LL |
LL |         Container(x) => x,
   |                   -
   |                   |
   |                   data moved here
   |                   move occurs because `x` has type `Struct`, which does not implement the `Copy` trait
   |
help: consider borrowing the pattern binding
   |
LL |         Container(ref x) => x,
   |                   +++

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0507, E0508.
For more information about an error, try `rustc --explain E0507`.