]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
1 | error: cannot borrow value as mutable more than once at a time |
2 | --> $DIR/borrowck-pat-ref-mut-twice.rs:28:9 | |
dfeec247 XL |
3 | | |
4 | LL | let ref mut a @ ref mut b = U; | |
5 | | ---------^^^--------- | |
6 | | | | | |
74b04a01 XL |
7 | | | another mutable borrow, by `b`, occurs here |
8 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 9 | |
74b04a01 XL |
10 | error: cannot borrow value as mutable more than once at a time |
11 | --> $DIR/borrowck-pat-ref-mut-twice.rs:32:9 | |
dfeec247 XL |
12 | | |
13 | LL | let ref mut a @ ref mut b = U; | |
14 | | ---------^^^--------- | |
15 | | | | | |
74b04a01 XL |
16 | | | another mutable borrow, by `b`, occurs here |
17 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 18 | |
74b04a01 XL |
19 | error: cannot borrow value as mutable more than once at a time |
20 | --> $DIR/borrowck-pat-ref-mut-twice.rs:35:9 | |
dfeec247 XL |
21 | | |
22 | LL | let ref mut a @ ref mut b = U; | |
23 | | ---------^^^--------- | |
24 | | | | | |
74b04a01 XL |
25 | | | another mutable borrow, by `b`, occurs here |
26 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 27 | |
74b04a01 XL |
28 | error: cannot borrow value as mutable more than once at a time |
29 | --> $DIR/borrowck-pat-ref-mut-twice.rs:38:9 | |
dfeec247 XL |
30 | | |
31 | LL | let ref mut a @ ref mut b = U; | |
32 | | ---------^^^--------- | |
33 | | | | | |
74b04a01 XL |
34 | | | another mutable borrow, by `b`, occurs here |
35 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 36 | |
74b04a01 XL |
37 | error: cannot borrow value as mutable more than once at a time |
38 | --> $DIR/borrowck-pat-ref-mut-twice.rs:42:9 | |
dfeec247 XL |
39 | | |
40 | LL | let ref mut a @ ref mut b = U; | |
41 | | ---------^^^--------- | |
42 | | | | | |
74b04a01 XL |
43 | | | another mutable borrow, by `b`, occurs here |
44 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 45 | |
74b04a01 XL |
46 | error: cannot borrow value as mutable more than once at a time |
47 | --> $DIR/borrowck-pat-ref-mut-twice.rs:46:9 | |
dfeec247 XL |
48 | | |
49 | LL | let ref mut a @ ( | |
50 | | ^-------- | |
51 | | | | |
74b04a01 | 52 | | _________first mutable borrow, by `a`, occurs here |
dfeec247 XL |
53 | | | |
54 | LL | | | |
55 | LL | | ref mut b, | |
74b04a01 | 56 | | | --------- another mutable borrow, by `b`, occurs here |
dfeec247 XL |
57 | LL | | [ |
58 | LL | | ref mut c, | |
74b04a01 | 59 | | | --------- another mutable borrow, by `c`, occurs here |
dfeec247 | 60 | LL | | ref mut d, |
74b04a01 | 61 | | | --------- another mutable borrow, by `d`, occurs here |
dfeec247 | 62 | LL | | ref e, |
74b04a01 | 63 | | | ----- also borrowed as immutable, by `e`, here |
dfeec247 XL |
64 | LL | | ] |
65 | LL | | ) = (U, [U, U, U]); | |
66 | | |_____^ | |
67 | ||
74b04a01 XL |
68 | error: cannot borrow value as mutable more than once at a time |
69 | --> $DIR/borrowck-pat-ref-mut-twice.rs:56:9 | |
dfeec247 XL |
70 | | |
71 | LL | let ref mut a @ ( | |
72 | | ^-------- | |
73 | | | | |
74b04a01 | 74 | | _________first mutable borrow, by `a`, occurs here |
dfeec247 XL |
75 | | | |
76 | LL | | | |
77 | LL | | ref mut b, | |
74b04a01 | 78 | | | --------- another mutable borrow, by `b`, occurs here |
dfeec247 XL |
79 | LL | | [ |
80 | LL | | ref mut c, | |
74b04a01 | 81 | | | --------- another mutable borrow, by `c`, occurs here |
dfeec247 | 82 | LL | | ref mut d, |
74b04a01 | 83 | | | --------- another mutable borrow, by `d`, occurs here |
dfeec247 | 84 | LL | | ref e, |
74b04a01 | 85 | | | ----- also borrowed as immutable, by `e`, here |
dfeec247 XL |
86 | LL | | ] |
87 | LL | | ) = (u(), [u(), u(), u()]); | |
88 | | |_________^ | |
89 | ||
74b04a01 XL |
90 | error: borrow of moved value |
91 | --> $DIR/borrowck-pat-ref-mut-twice.rs:66:9 | |
dfeec247 XL |
92 | | |
93 | LL | let a @ (ref mut b, ref mut c) = (U, U); | |
74b04a01 XL |
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 `(main::U, main::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 | |
dfeec247 XL |
103 | | |
104 | LL | let a @ (b, [c, d]) = &mut val; // Same as ^-- | |
74b04a01 XL |
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 (main::U, [main::U; 2])` which does not implement the `Copy` trait | |
dfeec247 | 112 | |
74b04a01 XL |
113 | error: borrow of moved value |
114 | --> $DIR/borrowck-pat-ref-mut-twice.rs:74:9 | |
dfeec247 XL |
115 | | |
116 | LL | let a @ &mut ref mut b = &mut U; | |
74b04a01 XL |
117 | | -^^^^^^^^--------- |
118 | | | | | |
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 | |
dfeec247 | 122 | |
74b04a01 XL |
123 | error: borrow of moved value |
124 | --> $DIR/borrowck-pat-ref-mut-twice.rs:77:9 | |
dfeec247 XL |
125 | | |
126 | LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U); | |
74b04a01 XL |
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 (main::U, main::U)` which does not implement the `Copy` trait | |
dfeec247 | 133 | |
74b04a01 XL |
134 | error: cannot borrow value as mutable more than once at a time |
135 | --> $DIR/borrowck-pat-ref-mut-twice.rs:82:9 | |
dfeec247 XL |
136 | | |
137 | LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => { | |
138 | | ---------^^^^^^---------^ | |
139 | | | | | |
74b04a01 XL |
140 | | | another mutable borrow, by `b`, occurs here |
141 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 142 | |
74b04a01 XL |
143 | error: cannot borrow value as mutable more than once at a time |
144 | --> $DIR/borrowck-pat-ref-mut-twice.rs:82:37 | |
dfeec247 XL |
145 | | |
146 | LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => { | |
147 | | ---------^^^^^^^---------^ | |
148 | | | | | |
74b04a01 XL |
149 | | | another mutable borrow, by `b`, occurs here |
150 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 151 | |
74b04a01 XL |
152 | error: cannot borrow value as mutable more than once at a time |
153 | --> $DIR/borrowck-pat-ref-mut-twice.rs:88:9 | |
dfeec247 XL |
154 | | |
155 | LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => { | |
156 | | ---------^^^^^^---------^ | |
157 | | | | | |
74b04a01 XL |
158 | | | another mutable borrow, by `b`, occurs here |
159 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 160 | |
74b04a01 XL |
161 | error: cannot borrow value as mutable more than once at a time |
162 | --> $DIR/borrowck-pat-ref-mut-twice.rs:88:37 | |
dfeec247 XL |
163 | | |
164 | LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => { | |
165 | | ---------^^^^^^^---------^ | |
166 | | | | | |
74b04a01 XL |
167 | | | another mutable borrow, by `b`, occurs here |
168 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 169 | |
74b04a01 XL |
170 | error: cannot borrow value as mutable more than once at a time |
171 | --> $DIR/borrowck-pat-ref-mut-twice.rs:95:9 | |
dfeec247 XL |
172 | | |
173 | LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => { | |
174 | | ---------^^^^^^---------^ | |
175 | | | | | |
74b04a01 XL |
176 | | | another mutable borrow, by `b`, occurs here |
177 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 178 | |
74b04a01 XL |
179 | error: cannot borrow value as mutable more than once at a time |
180 | --> $DIR/borrowck-pat-ref-mut-twice.rs:95:37 | |
dfeec247 XL |
181 | | |
182 | LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => { | |
183 | | ---------^^^^^^^---------^ | |
184 | | | | | |
74b04a01 XL |
185 | | | another mutable borrow, by `b`, occurs here |
186 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 187 | |
74b04a01 XL |
188 | error: cannot borrow value as mutable more than once at a time |
189 | --> $DIR/borrowck-pat-ref-mut-twice.rs:107:9 | |
dfeec247 XL |
190 | | |
191 | LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => { | |
192 | | ---------^^^^^^---------^ | |
193 | | | | | |
74b04a01 XL |
194 | | | another mutable borrow, by `b`, occurs here |
195 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 196 | |
74b04a01 XL |
197 | error: cannot borrow value as mutable more than once at a time |
198 | --> $DIR/borrowck-pat-ref-mut-twice.rs:107:37 | |
dfeec247 XL |
199 | | |
200 | LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => { | |
201 | | ---------^^^^^^^---------^ | |
202 | | | | | |
74b04a01 XL |
203 | | | another mutable borrow, by `b`, occurs here |
204 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 205 | |
74b04a01 XL |
206 | error: cannot borrow value as mutable more than once at a time |
207 | --> $DIR/borrowck-pat-ref-mut-twice.rs:11:11 | |
dfeec247 XL |
208 | | |
209 | LL | fn f1(ref mut a @ ref mut b: U) {} | |
210 | | ---------^^^--------- | |
211 | | | | | |
74b04a01 XL |
212 | | | another mutable borrow, by `b`, occurs here |
213 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 214 | |
74b04a01 XL |
215 | error: cannot borrow value as mutable more than once at a time |
216 | --> $DIR/borrowck-pat-ref-mut-twice.rs:13:11 | |
dfeec247 XL |
217 | | |
218 | LL | fn f2(ref mut a @ ref mut b: U) {} | |
219 | | ---------^^^--------- | |
220 | | | | | |
74b04a01 XL |
221 | | | another mutable borrow, by `b`, occurs here |
222 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 223 | |
74b04a01 XL |
224 | error: cannot borrow value as mutable more than once at a time |
225 | --> $DIR/borrowck-pat-ref-mut-twice.rs:16:9 | |
dfeec247 XL |
226 | | |
227 | LL | ref mut a @ [ | |
228 | | ^-------- | |
229 | | | | |
74b04a01 | 230 | | _________first mutable borrow, by `a`, occurs here |
dfeec247 XL |
231 | | | |
232 | LL | | | |
233 | LL | | [ref b @ .., _], | |
74b04a01 | 234 | | | ---------- also borrowed as immutable, by `b`, here |
dfeec247 | 235 | LL | | [_, ref mut mid @ ..], |
74b04a01 | 236 | | | ---------------- another mutable borrow, by `mid`, occurs here |
dfeec247 XL |
237 | LL | | .., |
238 | LL | | [..], | |
239 | LL | | ] : [[U; 4]; 5] | |
240 | | |_________^ | |
241 | ||
74b04a01 XL |
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 | ||
ba9703b0 | 261 | error[E0499]: cannot borrow value as mutable more than once at a time |
74b04a01 | 262 | --> $DIR/borrowck-pat-ref-mut-twice.rs:28:21 |
dfeec247 XL |
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 | ||
ba9703b0 | 273 | error[E0499]: cannot borrow value as mutable more than once at a time |
74b04a01 | 274 | --> $DIR/borrowck-pat-ref-mut-twice.rs:38:21 |
dfeec247 XL |
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 | |
74b04a01 | 286 | --> $DIR/borrowck-pat-ref-mut-twice.rs:66:25 |
dfeec247 XL |
287 | | |
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 | |
290 | | | | | |
291 | | | value borrowed here after move | |
292 | | value moved here | |
293 | ||
294 | error[E0382]: borrow of moved value | |
74b04a01 | 295 | --> $DIR/borrowck-pat-ref-mut-twice.rs:70:21 |
dfeec247 XL |
296 | | |
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 | |
299 | | | | | |
300 | | | value borrowed here after move | |
301 | | value moved here | |
302 | ||
303 | error[E0382]: borrow of moved value | |
74b04a01 | 304 | --> $DIR/borrowck-pat-ref-mut-twice.rs:74:18 |
dfeec247 XL |
305 | | |
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 | |
308 | | | | | |
309 | | | value borrowed here after move | |
310 | | value moved here | |
311 | ||
312 | error[E0382]: borrow of moved value | |
74b04a01 | 313 | --> $DIR/borrowck-pat-ref-mut-twice.rs:77:30 |
dfeec247 XL |
314 | | |
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 | |
317 | | | | | |
318 | | | value borrowed here after move | |
319 | | value moved here | |
320 | ||
ba9703b0 | 321 | error[E0499]: cannot borrow value as mutable more than once at a time |
74b04a01 | 322 | --> $DIR/borrowck-pat-ref-mut-twice.rs:95:24 |
dfeec247 XL |
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 | ||
ba9703b0 | 333 | error[E0499]: cannot borrow value as mutable more than once at a time |
74b04a01 | 334 | --> $DIR/borrowck-pat-ref-mut-twice.rs:95:53 |
dfeec247 XL |
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 | ||
ba9703b0 | 345 | error[E0499]: cannot borrow value as mutable more than once at a time |
74b04a01 | 346 | --> $DIR/borrowck-pat-ref-mut-twice.rs:107:24 |
dfeec247 XL |
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 | ||
ba9703b0 | 357 | error[E0499]: cannot borrow value as mutable more than once at a time |
74b04a01 | 358 | --> $DIR/borrowck-pat-ref-mut-twice.rs:107:53 |
dfeec247 XL |
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 | ||
74b04a01 | 369 | error: aborting due to 34 previous errors |
dfeec247 | 370 | |
74b04a01 XL |
371 | Some errors have detailed explanations: E0382, E0499. |
372 | For more information about an error, try `rustc --explain E0382`. |