1 error: cannot borrow `a` as mutable more than once at a time
2 --> $DIR/borrowck-pat-ref-mut-twice.rs:25:9
4 LL | let ref mut a @ ref mut b = U;
5 | ---------^^^---------
7 | | another mutable borrow occurs here
8 | first mutable borrow occurs here
10 error: cannot borrow `a` as mutable more than once at a time
11 --> $DIR/borrowck-pat-ref-mut-twice.rs:29:9
13 LL | let ref mut a @ ref mut b = U;
14 | ---------^^^---------
16 | | another mutable borrow occurs here
17 | first mutable borrow occurs here
19 error: cannot borrow `a` as mutable more than once at a time
20 --> $DIR/borrowck-pat-ref-mut-twice.rs:32:9
22 LL | let ref mut a @ ref mut b = U;
23 | ---------^^^---------
25 | | another mutable borrow occurs here
26 | first mutable borrow occurs here
28 error: cannot borrow `a` as mutable more than once at a time
29 --> $DIR/borrowck-pat-ref-mut-twice.rs:35:9
31 LL | let ref mut a @ ref mut b = U;
32 | ---------^^^---------
34 | | another mutable borrow occurs here
35 | first mutable borrow occurs here
37 error: cannot borrow `a` as mutable more than once at a time
38 --> $DIR/borrowck-pat-ref-mut-twice.rs:39:9
40 LL | let ref mut a @ ref mut b = U;
41 | ---------^^^---------
43 | | another mutable borrow occurs here
44 | first mutable borrow occurs here
46 error: cannot borrow `a` as mutable more than once at a time
47 --> $DIR/borrowck-pat-ref-mut-twice.rs:43:9
49 LL | let ref mut a @ (
52 | _________first mutable borrow occurs here
56 | | --------- another mutable borrow occurs here
59 | | --------- another mutable borrow occurs here
61 | | --------- another mutable borrow occurs here
63 | | ----- also borrowed as immutable here
65 LL | | ) = (U, [U, U, U]);
68 error: cannot borrow `a` as mutable more than once at a time
69 --> $DIR/borrowck-pat-ref-mut-twice.rs:53:9
71 LL | let ref mut a @ (
74 | _________first mutable borrow occurs here
78 | | --------- another mutable borrow occurs here
81 | | --------- another mutable borrow occurs here
83 | | --------- another mutable borrow occurs here
85 | | ----- also borrowed as immutable here
87 LL | | ) = (u(), [u(), u(), u()]);
90 error[E0007]: cannot bind by-move with sub-bindings
91 --> $DIR/borrowck-pat-ref-mut-twice.rs:63:9
93 LL | let a @ (ref mut b, ref mut c) = (U, U);
94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
96 error[E0007]: cannot bind by-move with sub-bindings
97 --> $DIR/borrowck-pat-ref-mut-twice.rs:67:9
99 LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
100 | ^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
102 error[E0007]: cannot bind by-move with sub-bindings
103 --> $DIR/borrowck-pat-ref-mut-twice.rs:71:9
105 LL | let a @ &mut ref mut b = &mut U;
106 | ^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
108 error[E0007]: cannot bind by-move with sub-bindings
109 --> $DIR/borrowck-pat-ref-mut-twice.rs:74:9
111 LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
114 error: cannot borrow `a` as mutable more than once at a time
115 --> $DIR/borrowck-pat-ref-mut-twice.rs:79:9
117 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
118 | ---------^^^^^^---------^
120 | | another mutable borrow occurs here
121 | first mutable borrow occurs here
123 error: cannot borrow `a` as mutable more than once at a time
124 --> $DIR/borrowck-pat-ref-mut-twice.rs:79:37
126 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
127 | ---------^^^^^^^---------^
129 | | another mutable borrow occurs here
130 | first mutable borrow occurs here
132 error: cannot borrow `a` as mutable more than once at a time
133 --> $DIR/borrowck-pat-ref-mut-twice.rs:85:9
135 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
136 | ---------^^^^^^---------^
138 | | another mutable borrow occurs here
139 | first mutable borrow occurs here
141 error: cannot borrow `a` as mutable more than once at a time
142 --> $DIR/borrowck-pat-ref-mut-twice.rs:85:37
144 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
145 | ---------^^^^^^^---------^
147 | | another mutable borrow occurs here
148 | first mutable borrow occurs here
150 error: cannot borrow `a` as mutable more than once at a time
151 --> $DIR/borrowck-pat-ref-mut-twice.rs:92:9
153 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
154 | ---------^^^^^^---------^
156 | | another mutable borrow occurs here
157 | first mutable borrow occurs here
159 error: cannot borrow `a` as mutable more than once at a time
160 --> $DIR/borrowck-pat-ref-mut-twice.rs:92:37
162 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
163 | ---------^^^^^^^---------^
165 | | another mutable borrow occurs here
166 | first mutable borrow occurs here
168 error: cannot borrow `a` as mutable more than once at a time
169 --> $DIR/borrowck-pat-ref-mut-twice.rs:104:9
171 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
172 | ---------^^^^^^---------^
174 | | another mutable borrow occurs here
175 | first mutable borrow occurs here
177 error: cannot borrow `a` as mutable more than once at a time
178 --> $DIR/borrowck-pat-ref-mut-twice.rs:104:37
180 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
181 | ---------^^^^^^^---------^
183 | | another mutable borrow occurs here
184 | first mutable borrow occurs here
186 error: cannot borrow `a` as mutable more than once at a time
187 --> $DIR/borrowck-pat-ref-mut-twice.rs:11:11
189 LL | fn f1(ref mut a @ ref mut b: U) {}
190 | ---------^^^---------
192 | | another mutable borrow occurs here
193 | first mutable borrow occurs here
195 error: cannot borrow `a` as mutable more than once at a time
196 --> $DIR/borrowck-pat-ref-mut-twice.rs:13:11
198 LL | fn f2(ref mut a @ ref mut b: U) {}
199 | ---------^^^---------
201 | | another mutable borrow occurs here
202 | first mutable borrow occurs here
204 error: cannot borrow `a` as mutable more than once at a time
205 --> $DIR/borrowck-pat-ref-mut-twice.rs:16:9
210 | _________first mutable borrow occurs here
213 LL | | [ref b @ .., _],
214 | | ---------- also borrowed as immutable here
215 LL | | [_, ref mut mid @ ..],
216 | | ---------------- another mutable borrow occurs here
219 LL | | ] : [[U; 4]; 5]
222 error[E0499]: cannot borrow `_` as mutable more than once at a time
223 --> $DIR/borrowck-pat-ref-mut-twice.rs:25:21
225 LL | let ref mut a @ ref mut b = U;
226 | ------------^^^^^^^^^
228 | | second mutable borrow occurs here
229 | first mutable borrow occurs here
232 | - first borrow later used here
234 error[E0499]: cannot borrow `_` as mutable more than once at a time
235 --> $DIR/borrowck-pat-ref-mut-twice.rs:35:21
237 LL | let ref mut a @ ref mut b = U;
238 | ------------^^^^^^^^^
240 | | second mutable borrow occurs here
241 | first mutable borrow occurs here
244 | ------ first borrow later used here
246 error[E0382]: borrow of moved value
247 --> $DIR/borrowck-pat-ref-mut-twice.rs:63:25
249 LL | let a @ (ref mut b, ref mut c) = (U, U);
250 | ----------------^^^^^^^^^- ------ move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait
252 | | value borrowed here after move
255 error[E0382]: borrow of moved value
256 --> $DIR/borrowck-pat-ref-mut-twice.rs:67:21
258 LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
259 | ------------^-- -------- move occurs because value has type `&mut (main::U, [main::U; 2])`, which does not implement the `Copy` trait
261 | | value borrowed here after move
264 error[E0382]: borrow of moved value
265 --> $DIR/borrowck-pat-ref-mut-twice.rs:71:18
267 LL | let a @ &mut ref mut b = &mut U;
268 | ---------^^^^^^^^^ ------ move occurs because value has type `&mut main::U`, which does not implement the `Copy` trait
270 | | value borrowed here after move
273 error[E0382]: borrow of moved value
274 --> $DIR/borrowck-pat-ref-mut-twice.rs:74:30
276 LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
277 | ---------------------^^^^^^^^^- ----------- move occurs because value has type `&mut (main::U, main::U)`, which does not implement the `Copy` trait
279 | | value borrowed here after move
282 error[E0499]: cannot borrow `_` as mutable more than once at a time
283 --> $DIR/borrowck-pat-ref-mut-twice.rs:92:24
285 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
286 | ---------------^^^^^^^^^-
288 | | second mutable borrow occurs here
289 | first mutable borrow occurs here
292 | ----------- first borrow later used here
294 error[E0499]: cannot borrow `_` as mutable more than once at a time
295 --> $DIR/borrowck-pat-ref-mut-twice.rs:92:53
297 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
298 | ----------------^^^^^^^^^-
300 | | second mutable borrow occurs here
301 | first mutable borrow occurs here
304 | ----------- first borrow later used here
306 error[E0499]: cannot borrow `_` as mutable more than once at a time
307 --> $DIR/borrowck-pat-ref-mut-twice.rs:104:24
309 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
310 | ---------------^^^^^^^^^-
312 | | second mutable borrow occurs here
313 | first mutable borrow occurs here
316 | - first borrow later used here
318 error[E0499]: cannot borrow `_` as mutable more than once at a time
319 --> $DIR/borrowck-pat-ref-mut-twice.rs:104:53
321 LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
322 | ----------------^^^^^^^^^-
324 | | second mutable borrow occurs here
325 | first mutable borrow occurs here
328 | - first borrow later used here
330 error: aborting due to 32 previous errors
332 Some errors have detailed explanations: E0007, E0382, E0499.
333 For more information about an error, try `rustc --explain E0007`.