summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/move-errors.stderr
blob: b03fcf70babe25850fcc3d068e15a4e282b63dda (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
error[E0507]: cannot move out of `*a` which is behind a shared reference
  --> $DIR/move-errors.rs:6:13
   |
LL |     let b = *a;
   |             ^^
   |             |
   |             move occurs because `*a` has type `A`, which does not implement the `Copy` trait
   |             help: consider borrowing here: `&*a`

error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
  --> $DIR/move-errors.rs:12:13
   |
LL |     let b = a[0];
   |             ^^^^
   |             |
   |             cannot move out of here
   |             move occurs because `a[_]` has type `A`, which does not implement the `Copy` trait
   |             help: consider borrowing here: `&a[0]`

error[E0507]: cannot move out of `**r` which is behind a shared reference
  --> $DIR/move-errors.rs:19:13
   |
LL |     let s = **r;
   |             ^^^
   |             |
   |             move occurs because `**r` has type `A`, which does not implement the `Copy` trait
   |             help: consider borrowing here: `&**r`

error[E0507]: cannot move out of an `Rc`
  --> $DIR/move-errors.rs:27:13
   |
LL |     let s = *r;
   |             ^^
   |             |
   |             move occurs because value has type `A`, which does not implement the `Copy` trait
   |             help: consider borrowing here: `&*r`

error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
  --> $DIR/move-errors.rs:32:13
   |
LL |     let a = [A("".to_string())][0];
   |             ^^^^^^^^^^^^^^^^^^^^^^
   |             |
   |             cannot move out of here
   |             move occurs because value has type `A`, which does not implement the `Copy` trait
   |             help: consider borrowing here: `&[A("".to_string())][0]`

error[E0507]: cannot move out of `a` which is behind a shared reference
  --> $DIR/move-errors.rs:38:16
   |
LL |     let A(s) = *a;
   |           -    ^^ help: consider borrowing here: `&*a`
   |           |
   |           data moved here
   |           move occurs because `s` has type `String`, which does not implement the `Copy` trait

error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
  --> $DIR/move-errors.rs:44:19
   |
LL |     let C(D(s)) = c;
   |             -     ^ cannot move out of here
   |             |
   |             data moved here
   |             move occurs because `s` has type `String`, which does not implement the `Copy` trait

error[E0507]: cannot move out of `*a` which is behind a shared reference
  --> $DIR/move-errors.rs:51:9
   |
LL |     b = *a;
   |         ^^ move occurs because `*a` has type `A`, which does not implement the `Copy` trait

error[E0508]: cannot move out of type `[B; 1]`, a non-copy array
  --> $DIR/move-errors.rs:74:11
   |
LL |     match x[0] {
   |           ^^^^
   |           |
   |           cannot move out of here
   |           help: consider borrowing here: `&x[0]`
LL |
LL |         B::U(d) => (),
   |              - data moved here
LL |         B::V(s) => (),
   |              - ...and here
   |
   = note: move occurs because these variables have types that don't implement the `Copy` trait

error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
  --> $DIR/move-errors.rs:83:11
   |
LL |     match x {
   |           ^ cannot move out of here
...
LL |         B::U(D(s)) => (),
   |                -
   |                |
   |                data moved here
   |                move occurs because `s` has type `String`, which does not implement the `Copy` trait

error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
  --> $DIR/move-errors.rs:92:11
   |
LL |     match x {
   |           ^ cannot move out of here
...
LL |         (D(s), &t) => (),
   |            -
   |            |
   |            data moved here
   |            move occurs because `s` has type `String`, which does not implement the `Copy` trait

error[E0507]: cannot move out of `*x.1` which is behind a shared reference
  --> $DIR/move-errors.rs:92:11
   |
LL |     match x {
   |           ^
...
LL |         (D(s), &t) => (),
   |                 -
   |                 |
   |                 data moved here
   |                 move occurs because `t` has type `String`, which does not implement the `Copy` trait

error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
  --> $DIR/move-errors.rs:102:11
   |
LL |     match x {
   |           ^ cannot move out of here
LL |
LL |         F(s, mut t) => (),
   |           -  ----- ...and here
   |           |
   |           data moved here
   |
   = note: move occurs because these variables have types that don't implement the `Copy` trait

error[E0507]: cannot move out of `x` as enum variant `Err` which is behind a shared reference
  --> $DIR/move-errors.rs:110:11
   |
LL |     match *x {
   |           ^^ help: consider borrowing here: `&*x`
LL |
LL |         Ok(s) | Err(s) => (),
   |            -
   |            |
   |            data moved here
   |            move occurs because `s` has type `String`, which does not implement the `Copy` trait

error: aborting due to 14 previous errors

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