1 error: cannot borrow value as mutable more than once at a time
2 --> $DIR/borrowck-pat-ref-mut-twice.rs:28:9
4 LL | let ref mut a @ ref mut b = U;
5 | ---------^^^---------
7 | | another mutable borrow, by `b`, occurs here
8 | first mutable borrow, by `a`, occurs here
10 error: cannot borrow value as mutable more than once at a time
11 --> $DIR/borrowck-pat-ref-mut-twice.rs:32:9
13 LL | let ref mut a @ ref mut b = U;
14 | ---------^^^---------
16 | | another mutable borrow, by `b`, occurs here
17 | first mutable borrow, by `a`, occurs here
19 error: cannot borrow value as mutable more than once at a time
20 --> $DIR/borrowck-pat-ref-mut-twice.rs:35:9
22 LL | let ref mut a @ ref mut b = U;
23 | ---------^^^---------
25 | | another mutable borrow, by `b`, occurs here
26 | first mutable borrow, by `a`, occurs here
28 error: cannot borrow value as mutable more than once at a time
29 --> $DIR/borrowck-pat-ref-mut-twice.rs:38:9
31 LL | let ref mut a @ ref mut b = U;
32 | ---------^^^---------
34 | | another mutable borrow, by `b`, occurs here
35 | first mutable borrow, by `a`, occurs here
37 error: cannot borrow value as mutable more than once at a time
38 --> $DIR/borrowck-pat-ref-mut-twice.rs:42:9
40 LL | let ref mut a @ ref mut b = U;
41 | ---------^^^---------
43 | | another mutable borrow, by `b`, occurs here
44 | first mutable borrow, by `a`, occurs here
46 error: cannot borrow value as mutable more than once at a time
47 --> $DIR/borrowck-pat-ref-mut-twice.rs:46:9
49 LL | let ref mut a @ (
52 | _________first mutable borrow, by `a`, occurs here
56 | | --------- another mutable borrow, by `b`, occurs here
59 | | --------- another mutable borrow, by `c`, occurs here
61 | | --------- another mutable borrow, by `d`, occurs here
63 | | ----- also borrowed as immutable, by `e`, here
65 LL | | ) = (U, [U, U, U]);
68 error: cannot borrow value as mutable more than once at a time
69 --> $DIR/borrowck-pat-ref-mut-twice.rs:56:9
71 LL | let ref mut a @ (
74 | _________first mutable borrow, by `a`, occurs here
78 | | --------- another mutable borrow, by `b`, occurs here
81 | | --------- another mutable borrow, by `c`, occurs here
83 | | --------- another mutable borrow, by `d`, occurs here
85 | | ----- also borrowed as immutable, by `e`, here
87 LL | | ) = (u(), [u(), u(), u()]);
90 error: borrow of moved value
91 --> $DIR/borrowck-pat-ref-mut-twice.rs:66:9
93 LL | let a @ (ref mut b, ref mut c) = (U, U);
94 | -^^^^---------^^---------^
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 `(main::U, main::U)` which does not implement the `Copy` trait
101 error: borrow of moved value
102 --> $DIR/borrowck-pat-ref-mut-twice.rs:70:9
104 LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
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 (main::U, [main::U; 2])` which does not implement the `Copy` trait
113 error: borrow of moved value
114 --> $DIR/borrowck-pat-ref-mut-twice.rs:74:9
116 LL | let a @ &mut ref mut b = &mut U;
119 | | value borrowed here after move
120 | value moved into `a` here
121 | move occurs because `a` has type `&mut main::U` which does not implement the `Copy` trait
123 error: borrow of moved value
124 --> $DIR/borrowck-pat-ref-mut-twice.rs:77:9
126 LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
127 | -^^^^^^^^^---------^^---------^
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 (main::U, main::U)` which does not implement the `Copy` trait
134 error: cannot borrow value as mutable more than once at a time
135 --> $DIR/borrowck-pat-ref-mut-twice.rs:82:9
137 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
138 | ---------^^^^^^---------^
140 | | another mutable borrow, by `b`, occurs here
141 | first mutable borrow, by `a`, occurs here
143 error: cannot borrow value as mutable more than once at a time
144 --> $DIR/borrowck-pat-ref-mut-twice.rs:82:37
146 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
147 | ---------^^^^^^^---------^
149 | | another mutable borrow, by `b`, occurs here
150 | first mutable borrow, by `a`, occurs here
152 error: cannot borrow value as mutable more than once at a time
153 --> $DIR/borrowck-pat-ref-mut-twice.rs:88:9
155 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
156 | ---------^^^^^^---------^
158 | | another mutable borrow, by `b`, occurs here
159 | first mutable borrow, by `a`, occurs here
161 error: cannot borrow value as mutable more than once at a time
162 --> $DIR/borrowck-pat-ref-mut-twice.rs:88:37
164 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
165 | ---------^^^^^^^---------^
167 | | another mutable borrow, by `b`, occurs here
168 | first mutable borrow, by `a`, occurs here
170 error: cannot borrow value as mutable more than once at a time
171 --> $DIR/borrowck-pat-ref-mut-twice.rs:95:9
173 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
174 | ---------^^^^^^---------^
176 | | another mutable borrow, by `b`, occurs here
177 | first mutable borrow, by `a`, occurs here
179 error: cannot borrow value as mutable more than once at a time
180 --> $DIR/borrowck-pat-ref-mut-twice.rs:95:37
182 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
183 | ---------^^^^^^^---------^
185 | | another mutable borrow, by `b`, occurs here
186 | first mutable borrow, by `a`, occurs here
188 error: cannot borrow value as mutable more than once at a time
189 --> $DIR/borrowck-pat-ref-mut-twice.rs:107:9
191 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
192 | ---------^^^^^^---------^
194 | | another mutable borrow, by `b`, occurs here
195 | first mutable borrow, by `a`, occurs here
197 error: cannot borrow value as mutable more than once at a time
198 --> $DIR/borrowck-pat-ref-mut-twice.rs:107:37
200 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
201 | ---------^^^^^^^---------^
203 | | another mutable borrow, by `b`, occurs here
204 | first mutable borrow, by `a`, occurs here
206 error: cannot borrow value as mutable more than once at a time
207 --> $DIR/borrowck-pat-ref-mut-twice.rs:11:11
209 LL | fn f1(ref mut a @ ref mut b: U) {}
210 | ---------^^^---------
212 | | another mutable borrow, by `b`, occurs here
213 | first mutable borrow, by `a`, occurs here
215 error: cannot borrow value as mutable more than once at a time
216 --> $DIR/borrowck-pat-ref-mut-twice.rs:13:11
218 LL | fn f2(ref mut a @ ref mut b: U) {}
219 | ---------^^^---------
221 | | another mutable borrow, by `b`, occurs here
222 | first mutable borrow, by `a`, occurs here
224 error: cannot borrow value as mutable more than once at a time
225 --> $DIR/borrowck-pat-ref-mut-twice.rs:16:9
230 | _________first mutable borrow, by `a`, occurs here
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
239 LL | | ] : [[U; 4]; 5]
242 error: cannot borrow value as mutable more than once at a time
243 --> $DIR/borrowck-pat-ref-mut-twice.rs:24:22
245 LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
246 | ---------^^^-------------
248 | | | also moved into `c` here
249 | | another mutable borrow, by `b`, occurs here
250 | first mutable borrow, by `a`, occurs here
252 error: cannot move out of value because it is borrowed
253 --> $DIR/borrowck-pat-ref-mut-twice.rs:24:34
255 LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
258 | | value moved into `c` here
259 | value borrowed, by `b`, here
261 error[E0499]: cannot borrow value as mutable more than once at a time
262 --> $DIR/borrowck-pat-ref-mut-twice.rs:28:21
264 LL | let ref mut a @ ref mut b = U;
265 | ------------^^^^^^^^^
267 | | second mutable borrow occurs here
268 | first mutable borrow occurs here
271 | - first borrow later used here
273 error[E0499]: cannot borrow value as mutable more than once at a time
274 --> $DIR/borrowck-pat-ref-mut-twice.rs:38:21
276 LL | let ref mut a @ ref mut b = U;
277 | ------------^^^^^^^^^
279 | | second mutable borrow occurs here
280 | first mutable borrow occurs here
283 | ------ first borrow later used here
285 error[E0382]: borrow of moved value
286 --> $DIR/borrowck-pat-ref-mut-twice.rs:66:25
288 LL | let a @ (ref mut b, ref mut c) = (U, U);
289 | ----------------^^^^^^^^^- ------ move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait
291 | | value borrowed here after move
294 error[E0382]: borrow of moved value
295 --> $DIR/borrowck-pat-ref-mut-twice.rs:70:21
297 LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
298 | ------------^-- -------- move occurs because value has type `&mut (main::U, [main::U; 2])`, which does not implement the `Copy` trait
300 | | value borrowed here after move
303 error[E0382]: borrow of moved value
304 --> $DIR/borrowck-pat-ref-mut-twice.rs:74:18
306 LL | let a @ &mut ref mut b = &mut U;
307 | ---------^^^^^^^^^ ------ move occurs because value has type `&mut main::U`, which does not implement the `Copy` trait
309 | | value borrowed here after move
312 error[E0382]: borrow of moved value
313 --> $DIR/borrowck-pat-ref-mut-twice.rs:77:30
315 LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
316 | ---------------------^^^^^^^^^- ----------- move occurs because value has type `&mut (main::U, main::U)`, which does not implement the `Copy` trait
318 | | value borrowed here after move
321 error[E0499]: cannot borrow value as mutable more than once at a time
322 --> $DIR/borrowck-pat-ref-mut-twice.rs:95:24
324 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
325 | ---------------^^^^^^^^^-
327 | | second mutable borrow occurs here
328 | first mutable borrow occurs here
331 | ----------- first borrow later used here
333 error[E0499]: cannot borrow value as mutable more than once at a time
334 --> $DIR/borrowck-pat-ref-mut-twice.rs:95:53
336 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
337 | ----------------^^^^^^^^^-
339 | | second mutable borrow occurs here
340 | first mutable borrow occurs here
343 | ----------- first borrow later used here
345 error[E0499]: cannot borrow value as mutable more than once at a time
346 --> $DIR/borrowck-pat-ref-mut-twice.rs:107:24
348 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
349 | ---------------^^^^^^^^^-
351 | | second mutable borrow occurs here
352 | first mutable borrow occurs here
355 | - first borrow later used here
357 error[E0499]: cannot borrow value as mutable more than once at a time
358 --> $DIR/borrowck-pat-ref-mut-twice.rs:107:53
360 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
361 | ----------------^^^^^^^^^-
363 | | second mutable borrow occurs here
364 | first mutable borrow occurs here
367 | - first borrow later used here
369 error: aborting due to 34 previous errors
371 Some errors have detailed explanations: E0382, E0499.
372 For more information about an error, try `rustc --explain E0382`.