]> git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / pattern / bindings-after-at / borrowck-pat-ref-mut-twice.stderr
1 error: cannot borrow value as mutable more than once at a time
2 --> $DIR/borrowck-pat-ref-mut-twice.rs:28:9
3 |
4 LL | let ref mut a @ ref mut b = U;
5 | ---------^^^---------
6 | | |
7 | | another mutable borrow, by `b`, occurs here
8 | first mutable borrow, by `a`, occurs here
9
10 error: cannot borrow value as mutable more than once at a time
11 --> $DIR/borrowck-pat-ref-mut-twice.rs:32:9
12 |
13 LL | let ref mut a @ ref mut b = U;
14 | ---------^^^---------
15 | | |
16 | | another mutable borrow, by `b`, occurs here
17 | first mutable borrow, by `a`, occurs here
18
19 error: cannot borrow value as mutable more than once at a time
20 --> $DIR/borrowck-pat-ref-mut-twice.rs:35:9
21 |
22 LL | let ref mut a @ ref mut b = U;
23 | ---------^^^---------
24 | | |
25 | | another mutable borrow, by `b`, occurs here
26 | first mutable borrow, by `a`, occurs here
27
28 error: cannot borrow value as mutable more than once at a time
29 --> $DIR/borrowck-pat-ref-mut-twice.rs:38:9
30 |
31 LL | let ref mut a @ ref mut b = U;
32 | ---------^^^---------
33 | | |
34 | | another mutable borrow, by `b`, occurs here
35 | first mutable borrow, by `a`, occurs here
36
37 error: cannot borrow value as mutable more than once at a time
38 --> $DIR/borrowck-pat-ref-mut-twice.rs:42:9
39 |
40 LL | let ref mut a @ ref mut b = U;
41 | ---------^^^---------
42 | | |
43 | | another mutable borrow, by `b`, occurs here
44 | first mutable borrow, by `a`, occurs here
45
46 error: cannot borrow value as mutable more than once at a time
47 --> $DIR/borrowck-pat-ref-mut-twice.rs:46:9
48 |
49 LL | let ref mut a @ (
50 | ^--------
51 | |
52 | _________first mutable borrow, by `a`, occurs here
53 | |
54 LL | |
55 LL | | ref mut b,
56 | | --------- another mutable borrow, by `b`, occurs here
57 LL | | [
58 LL | | ref mut c,
59 | | --------- another mutable borrow, by `c`, occurs here
60 LL | | ref mut d,
61 | | --------- another mutable borrow, by `d`, occurs here
62 LL | | ref e,
63 | | ----- also borrowed as immutable, by `e`, here
64 LL | | ]
65 LL | | ) = (U, [U, U, U]);
66 | |_____^
67
68 error: cannot borrow value as mutable more than once at a time
69 --> $DIR/borrowck-pat-ref-mut-twice.rs:56:9
70 |
71 LL | let ref mut a @ (
72 | ^--------
73 | |
74 | _________first mutable borrow, by `a`, occurs here
75 | |
76 LL | |
77 LL | | ref mut b,
78 | | --------- another mutable borrow, by `b`, occurs here
79 LL | | [
80 LL | | ref mut c,
81 | | --------- another mutable borrow, by `c`, occurs here
82 LL | | ref mut d,
83 | | --------- another mutable borrow, by `d`, occurs here
84 LL | | ref e,
85 | | ----- also borrowed as immutable, by `e`, here
86 LL | | ]
87 LL | | ) = (u(), [u(), u(), u()]);
88 | |_________^
89
90 error: borrow of moved value
91 --> $DIR/borrowck-pat-ref-mut-twice.rs:66:9
92 |
93 LL | let a @ (ref mut b, ref mut c) = (U, U);
94 | -^^^^---------^^---------^
95 | | | |
96 | | | value borrowed here after move
97 | | value borrowed here after move
98 | value moved into `a` here
99 | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
100
101 error: borrow of moved value
102 --> $DIR/borrowck-pat-ref-mut-twice.rs:70:9
103 |
104 LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
105 | -^^^^-^^^-^^-^^
106 | | | | |
107 | | | | value borrowed here after move
108 | | | value borrowed here after move
109 | | value borrowed here after move
110 | value moved into `a` here
111 | move occurs because `a` has type `&mut (U, [U; 2])` which does not implement the `Copy` trait
112
113 error: borrow of moved value
114 --> $DIR/borrowck-pat-ref-mut-twice.rs:74:9
115 |
116 LL | let a @ &mut ref mut b = &mut U;
117 | -^^^^^^^^---------
118 | | |
119 | | value borrowed here after move
120 | value moved into `a` here
121 | move occurs because `a` has type `&mut U` which does not implement the `Copy` trait
122
123 error: borrow of moved value
124 --> $DIR/borrowck-pat-ref-mut-twice.rs:77:9
125 |
126 LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
127 | -^^^^^^^^^---------^^---------^
128 | | | |
129 | | | value borrowed here after move
130 | | value borrowed here after move
131 | value moved into `a` here
132 | move occurs because `a` has type `&mut (U, U)` which does not implement the `Copy` trait
133
134 error: cannot borrow value as mutable more than once at a time
135 --> $DIR/borrowck-pat-ref-mut-twice.rs:82:9
136 |
137 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
138 | ---------^^^^^^---------^
139 | | |
140 | | another mutable borrow, by `b`, occurs here
141 | first mutable borrow, by `a`, occurs here
142
143 error: cannot borrow value as mutable more than once at a time
144 --> $DIR/borrowck-pat-ref-mut-twice.rs:82:37
145 |
146 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
147 | ---------^^^^^^^---------^
148 | | |
149 | | another mutable borrow, by `b`, occurs here
150 | first mutable borrow, by `a`, occurs here
151
152 error: cannot borrow value as mutable more than once at a time
153 --> $DIR/borrowck-pat-ref-mut-twice.rs:88:9
154 |
155 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
156 | ---------^^^^^^---------^
157 | | |
158 | | another mutable borrow, by `b`, occurs here
159 | first mutable borrow, by `a`, occurs here
160
161 error: cannot borrow value as mutable more than once at a time
162 --> $DIR/borrowck-pat-ref-mut-twice.rs:88:37
163 |
164 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
165 | ---------^^^^^^^---------^
166 | | |
167 | | another mutable borrow, by `b`, occurs here
168 | first mutable borrow, by `a`, occurs here
169
170 error: cannot borrow value as mutable more than once at a time
171 --> $DIR/borrowck-pat-ref-mut-twice.rs:95:9
172 |
173 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
174 | ---------^^^^^^---------^
175 | | |
176 | | another mutable borrow, by `b`, occurs here
177 | first mutable borrow, by `a`, occurs here
178
179 error: cannot borrow value as mutable more than once at a time
180 --> $DIR/borrowck-pat-ref-mut-twice.rs:95:37
181 |
182 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
183 | ---------^^^^^^^---------^
184 | | |
185 | | another mutable borrow, by `b`, occurs here
186 | first mutable borrow, by `a`, occurs here
187
188 error: cannot borrow value as mutable more than once at a time
189 --> $DIR/borrowck-pat-ref-mut-twice.rs:107:9
190 |
191 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
192 | ---------^^^^^^---------^
193 | | |
194 | | another mutable borrow, by `b`, occurs here
195 | first mutable borrow, by `a`, occurs here
196
197 error: cannot borrow value as mutable more than once at a time
198 --> $DIR/borrowck-pat-ref-mut-twice.rs:107:37
199 |
200 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
201 | ---------^^^^^^^---------^
202 | | |
203 | | another mutable borrow, by `b`, occurs here
204 | first mutable borrow, by `a`, occurs here
205
206 error: cannot borrow value as mutable more than once at a time
207 --> $DIR/borrowck-pat-ref-mut-twice.rs:11:11
208 |
209 LL | fn f1(ref mut a @ ref mut b: U) {}
210 | ---------^^^---------
211 | | |
212 | | another mutable borrow, by `b`, occurs here
213 | first mutable borrow, by `a`, occurs here
214
215 error: cannot borrow value as mutable more than once at a time
216 --> $DIR/borrowck-pat-ref-mut-twice.rs:13:11
217 |
218 LL | fn f2(ref mut a @ ref mut b: U) {}
219 | ---------^^^---------
220 | | |
221 | | another mutable borrow, by `b`, occurs here
222 | first mutable borrow, by `a`, occurs here
223
224 error: cannot borrow value as mutable more than once at a time
225 --> $DIR/borrowck-pat-ref-mut-twice.rs:16:9
226 |
227 LL | ref mut a @ [
228 | ^--------
229 | |
230 | _________first mutable borrow, by `a`, occurs here
231 | |
232 LL | |
233 LL | | [ref b @ .., _],
234 | | ---------- also borrowed as immutable, by `b`, here
235 LL | | [_, ref mut mid @ ..],
236 | | ---------------- another mutable borrow, by `mid`, occurs here
237 LL | | ..,
238 LL | | [..],
239 LL | | ] : [[U; 4]; 5]
240 | |_________^
241
242 error: cannot borrow value as mutable more than once at a time
243 --> $DIR/borrowck-pat-ref-mut-twice.rs:24:22
244 |
245 LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
246 | ---------^^^-------------
247 | | | |
248 | | | also moved into `c` here
249 | | another mutable borrow, by `b`, occurs here
250 | first mutable borrow, by `a`, occurs here
251
252 error: cannot move out of value because it is borrowed
253 --> $DIR/borrowck-pat-ref-mut-twice.rs:24:34
254 |
255 LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
256 | ---------^^^-
257 | | |
258 | | value moved into `c` here
259 | value borrowed, by `b`, here
260
261 error[E0499]: cannot borrow value as mutable more than once at a time
262 --> $DIR/borrowck-pat-ref-mut-twice.rs:28:21
263 |
264 LL | let ref mut a @ ref mut b = U;
265 | ------------^^^^^^^^^
266 | | |
267 | | second mutable borrow occurs here
268 | first mutable borrow occurs here
269 ...
270 LL | drop(a);
271 | - first borrow later used here
272
273 error[E0499]: cannot borrow value as mutable more than once at a time
274 --> $DIR/borrowck-pat-ref-mut-twice.rs:38:21
275 |
276 LL | let ref mut a @ ref mut b = U;
277 | ------------^^^^^^^^^
278 | | |
279 | | second mutable borrow occurs here
280 | first mutable borrow occurs here
281 ...
282 LL | *a = U;
283 | ------ first borrow later used here
284
285 error[E0382]: borrow of moved value
286 --> $DIR/borrowck-pat-ref-mut-twice.rs:66:25
287 |
288 LL | let a @ (ref mut b, ref mut c) = (U, U);
289 | ----------------^^^^^^^^^- ------ move occurs because value has type `(U, U)`, which does not implement the `Copy` trait
290 | | |
291 | | value borrowed here after move
292 | value moved here
293
294 error[E0382]: borrow of moved value
295 --> $DIR/borrowck-pat-ref-mut-twice.rs:70:21
296 |
297 LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
298 | ------------^-- -------- move occurs because value has type `&mut (U, [U; 2])`, which does not implement the `Copy` trait
299 | | |
300 | | value borrowed here after move
301 | value moved here
302
303 error[E0382]: borrow of moved value
304 --> $DIR/borrowck-pat-ref-mut-twice.rs:74:18
305 |
306 LL | let a @ &mut ref mut b = &mut U;
307 | ---------^^^^^^^^^ ------ move occurs because value has type `&mut U`, which does not implement the `Copy` trait
308 | | |
309 | | value borrowed here after move
310 | value moved here
311
312 error[E0382]: borrow of moved value
313 --> $DIR/borrowck-pat-ref-mut-twice.rs:77:30
314 |
315 LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
316 | ---------------------^^^^^^^^^- ----------- move occurs because value has type `&mut (U, U)`, which does not implement the `Copy` trait
317 | | |
318 | | value borrowed here after move
319 | value moved here
320
321 error[E0499]: cannot borrow value as mutable more than once at a time
322 --> $DIR/borrowck-pat-ref-mut-twice.rs:95:24
323 |
324 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
325 | ---------------^^^^^^^^^-
326 | | |
327 | | second mutable borrow occurs here
328 | first mutable borrow occurs here
329 ...
330 LL | *a = Err(U);
331 | ----------- first borrow later used here
332
333 error[E0499]: cannot borrow value as mutable more than once at a time
334 --> $DIR/borrowck-pat-ref-mut-twice.rs:95:53
335 |
336 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
337 | ----------------^^^^^^^^^-
338 | | |
339 | | second mutable borrow occurs here
340 | first mutable borrow occurs here
341 ...
342 LL | *a = Err(U);
343 | ----------- first borrow later used here
344
345 error[E0499]: cannot borrow value as mutable more than once at a time
346 --> $DIR/borrowck-pat-ref-mut-twice.rs:107:24
347 |
348 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
349 | ---------------^^^^^^^^^-
350 | | |
351 | | second mutable borrow occurs here
352 | first mutable borrow occurs here
353 ...
354 LL | drop(a);
355 | - first borrow later used here
356
357 error[E0499]: cannot borrow value as mutable more than once at a time
358 --> $DIR/borrowck-pat-ref-mut-twice.rs:107:53
359 |
360 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
361 | ----------------^^^^^^^^^-
362 | | |
363 | | second mutable borrow occurs here
364 | first mutable borrow occurs here
365 ...
366 LL | drop(a);
367 | - first borrow later used here
368
369 error: aborting due to 34 previous errors
370
371 Some errors have detailed explanations: E0382, E0499.
372 For more information about an error, try `rustc --explain E0382`.