]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/move-errors.stderr
Rollup merge of #105216 - GuillaumeGomez:rm-unused-gui-test, r=notriddle
[rust.git] / src / test / ui / nll / move-errors.stderr
1 error[E0507]: cannot move out of `*a` which is behind a shared reference
2   --> $DIR/move-errors.rs:6:13
3    |
4 LL |     let b = *a;
5    |             ^^
6    |             |
7    |             move occurs because `*a` has type `A`, which does not implement the `Copy` trait
8    |             help: consider borrowing here: `&*a`
9
10 error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
11   --> $DIR/move-errors.rs:12:13
12    |
13 LL |     let b = a[0];
14    |             ^^^^
15    |             |
16    |             cannot move out of here
17    |             move occurs because `a[_]` has type `A`, which does not implement the `Copy` trait
18    |             help: consider borrowing here: `&a[0]`
19
20 error[E0507]: cannot move out of `**r` which is behind a shared reference
21   --> $DIR/move-errors.rs:19:13
22    |
23 LL |     let s = **r;
24    |             ^^^
25    |             |
26    |             move occurs because `**r` has type `A`, which does not implement the `Copy` trait
27    |             help: consider borrowing here: `&**r`
28
29 error[E0507]: cannot move out of an `Rc`
30   --> $DIR/move-errors.rs:27:13
31    |
32 LL |     let s = *r;
33    |             ^^
34    |             |
35    |             move occurs because value has type `A`, which does not implement the `Copy` trait
36    |             help: consider borrowing here: `&*r`
37
38 error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
39   --> $DIR/move-errors.rs:32:13
40    |
41 LL |     let a = [A("".to_string())][0];
42    |             ^^^^^^^^^^^^^^^^^^^^^^
43    |             |
44    |             cannot move out of here
45    |             move occurs because value has type `A`, which does not implement the `Copy` trait
46    |             help: consider borrowing here: `&[A("".to_string())][0]`
47
48 error[E0507]: cannot move out of `a` which is behind a shared reference
49   --> $DIR/move-errors.rs:38:16
50    |
51 LL |     let A(s) = *a;
52    |           -    ^^ help: consider borrowing here: `&*a`
53    |           |
54    |           data moved here
55    |           move occurs because `s` has type `String`, which does not implement the `Copy` trait
56
57 error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
58   --> $DIR/move-errors.rs:44:19
59    |
60 LL |     let C(D(s)) = c;
61    |             -     ^ cannot move out of here
62    |             |
63    |             data moved here
64    |             move occurs because `s` has type `String`, which does not implement the `Copy` trait
65
66 error[E0507]: cannot move out of `*a` which is behind a shared reference
67   --> $DIR/move-errors.rs:51:9
68    |
69 LL |     b = *a;
70    |         ^^ move occurs because `*a` has type `A`, which does not implement the `Copy` trait
71
72 error[E0508]: cannot move out of type `[B; 1]`, a non-copy array
73   --> $DIR/move-errors.rs:74:11
74    |
75 LL |     match x[0] {
76    |           ^^^^
77    |           |
78    |           cannot move out of here
79    |           help: consider borrowing here: `&x[0]`
80 LL |
81 LL |         B::U(d) => (),
82    |              - data moved here
83 LL |         B::V(s) => (),
84    |              - ...and here
85    |
86    = note: move occurs because these variables have types that don't implement the `Copy` trait
87
88 error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
89   --> $DIR/move-errors.rs:83:11
90    |
91 LL |     match x {
92    |           ^ cannot move out of here
93 ...
94 LL |         B::U(D(s)) => (),
95    |                -
96    |                |
97    |                data moved here
98    |                move occurs because `s` has type `String`, which does not implement the `Copy` trait
99
100 error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
101   --> $DIR/move-errors.rs:92:11
102    |
103 LL |     match x {
104    |           ^ cannot move out of here
105 ...
106 LL |         (D(s), &t) => (),
107    |            -
108    |            |
109    |            data moved here
110    |            move occurs because `s` has type `String`, which does not implement the `Copy` trait
111
112 error[E0507]: cannot move out of `*x.1` which is behind a shared reference
113   --> $DIR/move-errors.rs:92:11
114    |
115 LL |     match x {
116    |           ^
117 ...
118 LL |         (D(s), &t) => (),
119    |                 -
120    |                 |
121    |                 data moved here
122    |                 move occurs because `t` has type `String`, which does not implement the `Copy` trait
123
124 error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
125   --> $DIR/move-errors.rs:102:11
126    |
127 LL |     match x {
128    |           ^ cannot move out of here
129 LL |
130 LL |         F(s, mut t) => (),
131    |           -  ----- ...and here
132    |           |
133    |           data moved here
134    |
135    = note: move occurs because these variables have types that don't implement the `Copy` trait
136
137 error[E0507]: cannot move out of `x` as enum variant `Err` which is behind a shared reference
138   --> $DIR/move-errors.rs:110:11
139    |
140 LL |     match *x {
141    |           ^^ help: consider borrowing here: `&*x`
142 LL |
143 LL |         Ok(s) | Err(s) => (),
144    |            -
145    |            |
146    |            data moved here
147    |            move occurs because `s` has type `String`, which does not implement the `Copy` trait
148
149 error: aborting due to 14 previous errors
150
151 Some errors have detailed explanations: E0507, E0508, E0509.
152 For more information about an error, try `rustc --explain E0507`.