]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binop/binop-consume-args.stderr
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / binop / binop-consume-args.stderr
1 error[E0382]: use of moved value: `lhs`
2   --> $DIR/binop-consume-args.rs:7:10
3    |
4 LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
5    |                                 --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
6 LL |     lhs + rhs;
7    |     --------- `lhs` moved due to usage in operator
8 LL |     drop(lhs);
9    |          ^^^ value used here after move
10    |
11 note: calling this operator moves the left-hand side
12   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
13    |
14 LL |     fn add(self, rhs: Rhs) -> Self::Output;
15    |            ^^^^
16 help: consider further restricting this bound
17    |
18 LL | fn add<A: Add<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
19    |                             ++++++
20
21 error[E0382]: use of moved value: `rhs`
22   --> $DIR/binop-consume-args.rs:8:10
23    |
24 LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
25    |                                         --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
26 LL |     lhs + rhs;
27    |           --- value moved here
28 LL |     drop(lhs);
29 LL |     drop(rhs);
30    |          ^^^ value used here after move
31    |
32 help: consider restricting type parameter `B`
33    |
34 LL | fn add<A: Add<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
35    |                               ++++++
36
37 error[E0382]: use of moved value: `lhs`
38   --> $DIR/binop-consume-args.rs:13:10
39    |
40 LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
41    |                                 --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
42 LL |     lhs - rhs;
43    |     --------- `lhs` moved due to usage in operator
44 LL |     drop(lhs);
45    |          ^^^ value used here after move
46    |
47 note: calling this operator moves the left-hand side
48   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
49    |
50 LL |     fn sub(self, rhs: Rhs) -> Self::Output;
51    |            ^^^^
52 help: consider further restricting this bound
53    |
54 LL | fn sub<A: Sub<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
55    |                             ++++++
56
57 error[E0382]: use of moved value: `rhs`
58   --> $DIR/binop-consume-args.rs:14:10
59    |
60 LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
61    |                                         --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
62 LL |     lhs - rhs;
63    |           --- value moved here
64 LL |     drop(lhs);
65 LL |     drop(rhs);
66    |          ^^^ value used here after move
67    |
68 help: consider restricting type parameter `B`
69    |
70 LL | fn sub<A: Sub<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
71    |                               ++++++
72
73 error[E0382]: use of moved value: `lhs`
74   --> $DIR/binop-consume-args.rs:19:10
75    |
76 LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
77    |                                 --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
78 LL |     lhs * rhs;
79    |     --------- `lhs` moved due to usage in operator
80 LL |     drop(lhs);
81    |          ^^^ value used here after move
82    |
83 note: calling this operator moves the left-hand side
84   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
85    |
86 LL |     fn mul(self, rhs: Rhs) -> Self::Output;
87    |            ^^^^
88 help: consider further restricting this bound
89    |
90 LL | fn mul<A: Mul<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
91    |                             ++++++
92
93 error[E0382]: use of moved value: `rhs`
94   --> $DIR/binop-consume-args.rs:20:10
95    |
96 LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
97    |                                         --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
98 LL |     lhs * rhs;
99    |           --- value moved here
100 LL |     drop(lhs);
101 LL |     drop(rhs);
102    |          ^^^ value used here after move
103    |
104 help: consider restricting type parameter `B`
105    |
106 LL | fn mul<A: Mul<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
107    |                               ++++++
108
109 error[E0382]: use of moved value: `lhs`
110   --> $DIR/binop-consume-args.rs:25:10
111    |
112 LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
113    |                                 --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
114 LL |     lhs / rhs;
115    |     --------- `lhs` moved due to usage in operator
116 LL |     drop(lhs);
117    |          ^^^ value used here after move
118    |
119 note: calling this operator moves the left-hand side
120   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
121    |
122 LL |     fn div(self, rhs: Rhs) -> Self::Output;
123    |            ^^^^
124 help: consider further restricting this bound
125    |
126 LL | fn div<A: Div<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
127    |                             ++++++
128
129 error[E0382]: use of moved value: `rhs`
130   --> $DIR/binop-consume-args.rs:26:10
131    |
132 LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
133    |                                         --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
134 LL |     lhs / rhs;
135    |           --- value moved here
136 LL |     drop(lhs);
137 LL |     drop(rhs);
138    |          ^^^ value used here after move
139    |
140 help: consider restricting type parameter `B`
141    |
142 LL | fn div<A: Div<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
143    |                               ++++++
144
145 error[E0382]: use of moved value: `lhs`
146   --> $DIR/binop-consume-args.rs:31:10
147    |
148 LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
149    |                                 --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
150 LL |     lhs % rhs;
151    |     --------- `lhs` moved due to usage in operator
152 LL |     drop(lhs);
153    |          ^^^ value used here after move
154    |
155 note: calling this operator moves the left-hand side
156   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
157    |
158 LL |     fn rem(self, rhs: Rhs) -> Self::Output;
159    |            ^^^^
160 help: consider further restricting this bound
161    |
162 LL | fn rem<A: Rem<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
163    |                             ++++++
164
165 error[E0382]: use of moved value: `rhs`
166   --> $DIR/binop-consume-args.rs:32:10
167    |
168 LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
169    |                                         --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
170 LL |     lhs % rhs;
171    |           --- value moved here
172 LL |     drop(lhs);
173 LL |     drop(rhs);
174    |          ^^^ value used here after move
175    |
176 help: consider restricting type parameter `B`
177    |
178 LL | fn rem<A: Rem<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
179    |                               ++++++
180
181 error[E0382]: use of moved value: `lhs`
182   --> $DIR/binop-consume-args.rs:37:10
183    |
184 LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
185    |                                       --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
186 LL |     lhs & rhs;
187    |     --------- `lhs` moved due to usage in operator
188 LL |     drop(lhs);
189    |          ^^^ value used here after move
190    |
191 note: calling this operator moves the left-hand side
192   --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
193    |
194 LL |     fn bitand(self, rhs: Rhs) -> Self::Output;
195    |               ^^^^
196 help: consider further restricting this bound
197    |
198 LL | fn bitand<A: BitAnd<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
199    |                                   ++++++
200
201 error[E0382]: use of moved value: `rhs`
202   --> $DIR/binop-consume-args.rs:38:10
203    |
204 LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
205    |                                               --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
206 LL |     lhs & rhs;
207    |           --- value moved here
208 LL |     drop(lhs);
209 LL |     drop(rhs);
210    |          ^^^ value used here after move
211    |
212 help: consider restricting type parameter `B`
213    |
214 LL | fn bitand<A: BitAnd<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
215    |                                     ++++++
216
217 error[E0382]: use of moved value: `lhs`
218   --> $DIR/binop-consume-args.rs:43:10
219    |
220 LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
221    |                                     --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
222 LL |     lhs | rhs;
223    |     --------- `lhs` moved due to usage in operator
224 LL |     drop(lhs);
225    |          ^^^ value used here after move
226    |
227 note: calling this operator moves the left-hand side
228   --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
229    |
230 LL |     fn bitor(self, rhs: Rhs) -> Self::Output;
231    |              ^^^^
232 help: consider further restricting this bound
233    |
234 LL | fn bitor<A: BitOr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
235    |                                 ++++++
236
237 error[E0382]: use of moved value: `rhs`
238   --> $DIR/binop-consume-args.rs:44:10
239    |
240 LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
241    |                                             --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
242 LL |     lhs | rhs;
243    |           --- value moved here
244 LL |     drop(lhs);
245 LL |     drop(rhs);
246    |          ^^^ value used here after move
247    |
248 help: consider restricting type parameter `B`
249    |
250 LL | fn bitor<A: BitOr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
251    |                                   ++++++
252
253 error[E0382]: use of moved value: `lhs`
254   --> $DIR/binop-consume-args.rs:49:10
255    |
256 LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
257    |                                       --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
258 LL |     lhs ^ rhs;
259    |     --------- `lhs` moved due to usage in operator
260 LL |     drop(lhs);
261    |          ^^^ value used here after move
262    |
263 note: calling this operator moves the left-hand side
264   --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
265    |
266 LL |     fn bitxor(self, rhs: Rhs) -> Self::Output;
267    |               ^^^^
268 help: consider further restricting this bound
269    |
270 LL | fn bitxor<A: BitXor<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
271    |                                   ++++++
272
273 error[E0382]: use of moved value: `rhs`
274   --> $DIR/binop-consume-args.rs:50:10
275    |
276 LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
277    |                                               --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
278 LL |     lhs ^ rhs;
279    |           --- value moved here
280 LL |     drop(lhs);
281 LL |     drop(rhs);
282    |          ^^^ value used here after move
283    |
284 help: consider restricting type parameter `B`
285    |
286 LL | fn bitxor<A: BitXor<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
287    |                                     ++++++
288
289 error[E0382]: use of moved value: `lhs`
290   --> $DIR/binop-consume-args.rs:55:10
291    |
292 LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
293    |                                 --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
294 LL |     lhs << rhs;
295    |     ---------- `lhs` moved due to usage in operator
296 LL |     drop(lhs);
297    |          ^^^ value used here after move
298    |
299 note: calling this operator moves the left-hand side
300   --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
301    |
302 LL |     fn shl(self, rhs: Rhs) -> Self::Output;
303    |            ^^^^
304 help: consider further restricting this bound
305    |
306 LL | fn shl<A: Shl<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
307    |                             ++++++
308
309 error[E0382]: use of moved value: `rhs`
310   --> $DIR/binop-consume-args.rs:56:10
311    |
312 LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
313    |                                         --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
314 LL |     lhs << rhs;
315    |            --- value moved here
316 LL |     drop(lhs);
317 LL |     drop(rhs);
318    |          ^^^ value used here after move
319    |
320 help: consider restricting type parameter `B`
321    |
322 LL | fn shl<A: Shl<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
323    |                               ++++++
324
325 error[E0382]: use of moved value: `lhs`
326   --> $DIR/binop-consume-args.rs:61:10
327    |
328 LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
329    |                                 --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
330 LL |     lhs >> rhs;
331    |     ---------- `lhs` moved due to usage in operator
332 LL |     drop(lhs);
333    |          ^^^ value used here after move
334    |
335 note: calling this operator moves the left-hand side
336   --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
337    |
338 LL |     fn shr(self, rhs: Rhs) -> Self::Output;
339    |            ^^^^
340 help: consider further restricting this bound
341    |
342 LL | fn shr<A: Shr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
343    |                             ++++++
344
345 error[E0382]: use of moved value: `rhs`
346   --> $DIR/binop-consume-args.rs:62:10
347    |
348 LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
349    |                                         --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
350 LL |     lhs >> rhs;
351    |            --- value moved here
352 LL |     drop(lhs);
353 LL |     drop(rhs);
354    |          ^^^ value used here after move
355    |
356 help: consider restricting type parameter `B`
357    |
358 LL | fn shr<A: Shr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
359    |                               ++++++
360
361 error: aborting due to 20 previous errors
362
363 For more information about this error, try `rustc --explain E0382`.