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