]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
1 | error: cannot borrow value as immutable because it is also borrowed as mutable |
2 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:11:9 | |
dfeec247 XL |
3 | | |
4 | LL | ref mut z @ &mut Some(ref a) => { | |
5 | | ---------^^^^^^^^^^^^^-----^ | |
6 | | | | | |
74b04a01 XL |
7 | | | immutable borrow, by `a`, occurs here |
8 | | mutable borrow, by `z`, 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-and-ref.rs:35:9 | |
dfeec247 XL |
12 | | |
13 | LL | let ref mut a @ (ref b @ ref mut c) = u(); // sub-in-sub | |
14 | | ---------^^^^-----------------^ | |
15 | | | | | | |
74b04a01 XL |
16 | | | | another mutable borrow, by `c`, occurs here |
17 | | | also borrowed as immutable, by `b`, here | |
18 | | first mutable borrow, by `a`, occurs here | |
dfeec247 | 19 | |
74b04a01 XL |
20 | error: cannot borrow value as mutable because it is also borrowed as immutable |
21 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:35:22 | |
dfeec247 XL |
22 | | |
23 | LL | let ref mut a @ (ref b @ ref mut c) = u(); // sub-in-sub | |
24 | | -----^^^--------- | |
25 | | | | | |
74b04a01 XL |
26 | | | mutable borrow, by `c`, occurs here |
27 | | immutable borrow, by `b`, occurs here | |
dfeec247 | 28 | |
74b04a01 XL |
29 | error: cannot borrow value as mutable because it is also borrowed as immutable |
30 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:39:9 | |
dfeec247 XL |
31 | | |
32 | LL | let ref a @ ref mut b = U; | |
33 | | -----^^^--------- | |
34 | | | | | |
74b04a01 XL |
35 | | | mutable borrow, by `b`, occurs here |
36 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 37 | |
74b04a01 XL |
38 | error: cannot borrow value as immutable because it is also borrowed as mutable |
39 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:41:9 | |
dfeec247 XL |
40 | | |
41 | LL | let ref mut a @ ref b = U; | |
42 | | ---------^^^----- | |
43 | | | | | |
74b04a01 XL |
44 | | | immutable borrow, by `b`, occurs here |
45 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 46 | |
74b04a01 XL |
47 | error: cannot borrow value as mutable because it is also borrowed as immutable |
48 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:43:9 | |
dfeec247 XL |
49 | | |
50 | LL | let ref a @ (ref mut b, ref mut c) = (U, U); | |
51 | | -----^^^^---------^^---------^ | |
52 | | | | | | |
74b04a01 XL |
53 | | | | mutable borrow, by `c`, occurs here |
54 | | | mutable borrow, by `b`, occurs here | |
55 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 56 | |
74b04a01 XL |
57 | error: cannot borrow value as immutable because it is also borrowed as mutable |
58 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:45:9 | |
dfeec247 XL |
59 | | |
60 | LL | let ref mut a @ (ref b, ref c) = (U, U); | |
61 | | ---------^^^^-----^^-----^ | |
62 | | | | | | |
74b04a01 XL |
63 | | | | immutable borrow, by `c`, occurs here |
64 | | | immutable borrow, by `b`, occurs here | |
65 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 66 | |
74b04a01 XL |
67 | error: cannot borrow value as immutable because it is also borrowed as mutable |
68 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:48:9 | |
dfeec247 XL |
69 | | |
70 | LL | let ref mut a @ ref b = u(); | |
71 | | ---------^^^----- | |
72 | | | | | |
74b04a01 XL |
73 | | | immutable borrow, by `b`, occurs here |
74 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 75 | |
74b04a01 XL |
76 | error: cannot borrow value as mutable because it is also borrowed as immutable |
77 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:53:9 | |
dfeec247 XL |
78 | | |
79 | LL | let ref a @ ref mut b = u(); | |
80 | | -----^^^--------- | |
81 | | | | | |
74b04a01 XL |
82 | | | mutable borrow, by `b`, occurs here |
83 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 84 | |
74b04a01 XL |
85 | error: cannot borrow value as immutable because it is also borrowed as mutable |
86 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:59:9 | |
dfeec247 XL |
87 | | |
88 | LL | let ref mut a @ ref b = U; | |
89 | | ---------^^^----- | |
90 | | | | | |
74b04a01 XL |
91 | | | immutable borrow, by `b`, occurs here |
92 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 93 | |
74b04a01 XL |
94 | error: cannot borrow value as mutable because it is also borrowed as immutable |
95 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:63:9 | |
dfeec247 XL |
96 | | |
97 | LL | let ref a @ ref mut b = U; | |
98 | | -----^^^--------- | |
99 | | | | | |
74b04a01 XL |
100 | | | mutable borrow, by `b`, occurs here |
101 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 102 | |
74b04a01 XL |
103 | error: cannot borrow value as immutable because it is also borrowed as mutable |
104 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:69:9 | |
dfeec247 XL |
105 | | |
106 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) => { | |
107 | | ---------^^^^^^-----^ | |
108 | | | | | |
74b04a01 XL |
109 | | | immutable borrow, by `b`, occurs here |
110 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 111 | |
74b04a01 XL |
112 | error: cannot borrow value as immutable because it is also borrowed as mutable |
113 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:69:33 | |
dfeec247 XL |
114 | | |
115 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) => { | |
116 | | ---------^^^^^^^-----^ | |
117 | | | | | |
74b04a01 XL |
118 | | | immutable borrow, by `b`, occurs here |
119 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 120 | |
74b04a01 XL |
121 | error: cannot borrow value as mutable because it is also borrowed as immutable |
122 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:78:9 | |
dfeec247 XL |
123 | | |
124 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => { | |
125 | | -----^^^^^^---------^ | |
126 | | | | | |
74b04a01 XL |
127 | | | mutable borrow, by `b`, occurs here |
128 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 129 | |
74b04a01 XL |
130 | error: cannot borrow value as mutable because it is also borrowed as immutable |
131 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:78:33 | |
dfeec247 XL |
132 | | |
133 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => { | |
134 | | -----^^^^^^^---------^ | |
135 | | | | | |
74b04a01 XL |
136 | | | mutable borrow, by `b`, occurs here |
137 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 138 | |
74b04a01 XL |
139 | error: cannot borrow value as mutable because it is also borrowed as immutable |
140 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:89:9 | |
dfeec247 XL |
141 | | |
142 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {} | |
143 | | -----^^^^^^---------^ | |
144 | | | | | |
74b04a01 XL |
145 | | | mutable borrow, by `b`, occurs here |
146 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 147 | |
74b04a01 XL |
148 | error: cannot borrow value as mutable because it is also borrowed as immutable |
149 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:89:33 | |
dfeec247 XL |
150 | | |
151 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {} | |
152 | | -----^^^^^^^---------^ | |
153 | | | | | |
74b04a01 XL |
154 | | | mutable borrow, by `b`, occurs here |
155 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 156 | |
74b04a01 XL |
157 | error: cannot borrow value as immutable because it is also borrowed as mutable |
158 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:96:9 | |
dfeec247 XL |
159 | | |
160 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {} | |
161 | | ---------^^^^^^-----^ | |
162 | | | | | |
74b04a01 XL |
163 | | | immutable borrow, by `b`, occurs here |
164 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 165 | |
74b04a01 XL |
166 | error: cannot borrow value as immutable because it is also borrowed as mutable |
167 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:96:33 | |
dfeec247 XL |
168 | | |
169 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {} | |
170 | | ---------^^^^^^^-----^ | |
171 | | | | | |
74b04a01 XL |
172 | | | immutable borrow, by `b`, occurs here |
173 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 174 | |
74b04a01 XL |
175 | error: cannot borrow value as mutable because it is also borrowed as immutable |
176 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:9 | |
dfeec247 XL |
177 | | |
178 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {} | |
179 | | -----^^^^^^---------^ | |
180 | | | | | |
74b04a01 XL |
181 | | | mutable borrow, by `b`, occurs here |
182 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 183 | |
74b04a01 XL |
184 | error: cannot borrow value as mutable because it is also borrowed as immutable |
185 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:33 | |
dfeec247 XL |
186 | | |
187 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {} | |
188 | | -----^^^^^^^---------^ | |
189 | | | | | |
74b04a01 XL |
190 | | | mutable borrow, by `b`, occurs here |
191 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 192 | |
74b04a01 XL |
193 | error: cannot borrow value as immutable because it is also borrowed as mutable |
194 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:9 | |
dfeec247 XL |
195 | | |
196 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {} | |
197 | | ---------^^^^^^-----^ | |
198 | | | | | |
74b04a01 XL |
199 | | | immutable borrow, by `b`, occurs here |
200 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 201 | |
74b04a01 XL |
202 | error: cannot borrow value as immutable because it is also borrowed as mutable |
203 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:33 | |
dfeec247 XL |
204 | | |
205 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {} | |
206 | | ---------^^^^^^^-----^ | |
207 | | | | | |
74b04a01 XL |
208 | | | immutable borrow, by `b`, occurs here |
209 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 210 | |
74b04a01 XL |
211 | error: cannot borrow value as mutable because it is also borrowed as immutable |
212 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:119:9 | |
dfeec247 XL |
213 | | |
214 | LL | let ref a @ (ref mut b, ref mut c) = (U, U); | |
215 | | -----^^^^---------^^---------^ | |
216 | | | | | | |
74b04a01 XL |
217 | | | | mutable borrow, by `c`, occurs here |
218 | | | mutable borrow, by `b`, occurs here | |
219 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 220 | |
74b04a01 XL |
221 | error: cannot borrow value as mutable because it is also borrowed as immutable |
222 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:124:9 | |
dfeec247 XL |
223 | | |
224 | LL | let ref a @ (ref mut b, ref mut c) = (U, U); | |
225 | | -----^^^^---------^^---------^ | |
226 | | | | | | |
74b04a01 XL |
227 | | | | mutable borrow, by `c`, occurs here |
228 | | | mutable borrow, by `b`, occurs here | |
229 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 230 | |
74b04a01 XL |
231 | error: cannot borrow value as mutable because it is also borrowed as immutable |
232 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:131:9 | |
dfeec247 XL |
233 | | |
234 | LL | let ref a @ (ref mut b, ref mut c) = (U, U); | |
235 | | -----^^^^---------^^---------^ | |
236 | | | | | | |
74b04a01 XL |
237 | | | | mutable borrow, by `c`, occurs here |
238 | | | mutable borrow, by `b`, occurs here | |
239 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 240 | |
74b04a01 XL |
241 | error: cannot borrow value as immutable because it is also borrowed as mutable |
242 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:136:9 | |
dfeec247 XL |
243 | | |
244 | LL | let ref mut a @ (ref b, ref c) = (U, U); | |
245 | | ---------^^^^-----^^-----^ | |
246 | | | | | | |
74b04a01 XL |
247 | | | | immutable borrow, by `c`, occurs here |
248 | | | immutable borrow, by `b`, occurs here | |
249 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 250 | |
74b04a01 XL |
251 | error: cannot borrow value as mutable because it is also borrowed as immutable |
252 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:25:11 | |
dfeec247 XL |
253 | | |
254 | LL | fn f1(ref a @ ref mut b: U) {} | |
255 | | -----^^^--------- | |
256 | | | | | |
74b04a01 XL |
257 | | | mutable borrow, by `b`, occurs here |
258 | | immutable borrow, by `a`, occurs here | |
dfeec247 | 259 | |
74b04a01 XL |
260 | error: cannot borrow value as immutable because it is also borrowed as mutable |
261 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:27:11 | |
dfeec247 XL |
262 | | |
263 | LL | fn f2(ref mut a @ ref b: U) {} | |
264 | | ---------^^^----- | |
265 | | | | | |
74b04a01 XL |
266 | | | immutable borrow, by `b`, occurs here |
267 | | mutable borrow, by `a`, occurs here | |
dfeec247 | 268 | |
74b04a01 XL |
269 | error: cannot borrow value as mutable because it is also borrowed as immutable |
270 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:29:11 | |
dfeec247 XL |
271 | | |
272 | LL | fn f3(ref a @ [ref b, ref mut mid @ .., ref c]: [U; 4]) {} | |
273 | | -----^^^^^^^^^^^----------------^^^^^^^^ | |
274 | | | | | |
74b04a01 XL |
275 | | | mutable borrow, by `mid`, occurs here |
276 | | immutable borrow, by `a`, occurs here | |
277 | ||
278 | error: cannot borrow value as mutable because it is also borrowed as immutable | |
279 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:31:22 | |
280 | | | |
281 | LL | fn f4_also_moved(ref a @ ref mut b @ c: U) {} | |
282 | | -----^^^------------- | |
283 | | | | | | |
284 | | | | also moved into `c` here | |
285 | | | mutable borrow, by `b`, occurs here | |
286 | | immutable borrow, by `a`, occurs here | |
287 | ||
288 | error: cannot move out of value because it is borrowed | |
289 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:31:30 | |
290 | | | |
291 | LL | fn f4_also_moved(ref a @ ref mut b @ c: U) {} | |
292 | | ---------^^^- | |
293 | | | | | |
294 | | | value moved into `c` here | |
295 | | value borrowed, by `b`, here | |
dfeec247 | 296 | |
ba9703b0 | 297 | error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable |
74b04a01 | 298 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:11:31 |
dfeec247 XL |
299 | | |
300 | LL | ref mut z @ &mut Some(ref a) => { | |
301 | | ----------------------^^^^^- | |
302 | | | | | |
303 | | | immutable borrow occurs here | |
304 | | mutable borrow occurs here | |
305 | ... | |
306 | LL | **z = None; | |
307 | | ---------- mutable borrow later used here | |
308 | ||
ba9703b0 | 309 | error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable |
74b04a01 | 310 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:48:21 |
dfeec247 XL |
311 | | |
312 | LL | let ref mut a @ ref b = u(); | |
313 | | ------------^^^^^ | |
314 | | | | | |
315 | | | immutable borrow occurs here | |
316 | | mutable borrow occurs here | |
317 | ... | |
318 | LL | *a = u(); | |
319 | | -------- mutable borrow later used here | |
320 | ||
ba9703b0 | 321 | error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable |
74b04a01 | 322 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:53:17 |
dfeec247 XL |
323 | | |
324 | LL | let ref a @ ref mut b = u(); | |
325 | | --------^^^^^^^^^ | |
326 | | | | | |
327 | | | mutable borrow occurs here | |
328 | | immutable borrow occurs here | |
329 | ... | |
330 | LL | drop(a); | |
331 | | - immutable borrow later used here | |
332 | ||
ba9703b0 | 333 | error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable |
74b04a01 | 334 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:78:20 |
dfeec247 XL |
335 | | |
336 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => { | |
337 | | -----------^^^^^^^^^- | |
338 | | | | | |
339 | | | mutable borrow occurs here | |
340 | | immutable borrow occurs here | |
341 | ... | |
342 | LL | drop(a); | |
343 | | - immutable borrow later used here | |
344 | ||
ba9703b0 | 345 | error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable |
74b04a01 | 346 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:78:45 |
dfeec247 XL |
347 | | |
348 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => { | |
349 | | ------------^^^^^^^^^- | |
350 | | | | | |
351 | | | mutable borrow occurs here | |
352 | | immutable borrow occurs here | |
353 | ... | |
354 | LL | drop(a); | |
355 | | - immutable borrow later used here | |
356 | ||
357 | error[E0594]: cannot assign to `*b`, as it is immutable for the pattern guard | |
74b04a01 | 358 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:89:61 |
dfeec247 XL |
359 | | |
360 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {} | |
361 | | ^^^^^^ cannot assign | |
362 | | | |
363 | = note: variables bound in patterns are immutable until the end of the pattern guard | |
364 | ||
365 | error[E0594]: cannot assign to `*a`, as it is immutable for the pattern guard | |
74b04a01 | 366 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:96:61 |
dfeec247 XL |
367 | | |
368 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {} | |
369 | | ^^^^^^^^^^^ cannot assign | |
370 | | | |
371 | = note: variables bound in patterns are immutable until the end of the pattern guard | |
372 | ||
373 | error[E0507]: cannot move out of `b` in pattern guard | |
74b04a01 | 374 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:66 |
dfeec247 XL |
375 | | |
376 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {} | |
1b1a35ee | 377 | | ^ move occurs because `b` has type `&mut U`, which does not implement the `Copy` trait |
dfeec247 XL |
378 | | |
379 | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard | |
380 | ||
381 | error[E0507]: cannot move out of `b` in pattern guard | |
74b04a01 | 382 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:66 |
dfeec247 XL |
383 | | |
384 | LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {} | |
1b1a35ee | 385 | | ^ move occurs because `b` has type `&mut U`, which does not implement the `Copy` trait |
dfeec247 XL |
386 | | |
387 | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard | |
388 | ||
389 | error[E0507]: cannot move out of `a` in pattern guard | |
74b04a01 | 390 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:66 |
dfeec247 XL |
391 | | |
392 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {} | |
1b1a35ee | 393 | | ^ move occurs because `a` has type `&mut std::result::Result<U, U>`, which does not implement the `Copy` trait |
dfeec247 XL |
394 | | |
395 | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard | |
396 | ||
397 | error[E0507]: cannot move out of `a` in pattern guard | |
74b04a01 | 398 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:66 |
dfeec247 XL |
399 | | |
400 | LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {} | |
1b1a35ee | 401 | | ^ move occurs because `a` has type `&mut std::result::Result<U, U>`, which does not implement the `Copy` trait |
dfeec247 XL |
402 | | |
403 | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard | |
404 | ||
ba9703b0 | 405 | error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable |
74b04a01 | 406 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:124:18 |
dfeec247 XL |
407 | | |
408 | LL | let ref a @ (ref mut b, ref mut c) = (U, U); | |
409 | | ---------^^^^^^^^^------------ | |
410 | | | | | |
411 | | | mutable borrow occurs here | |
412 | | immutable borrow occurs here | |
413 | ... | |
414 | LL | drop(a); | |
415 | | - immutable borrow later used here | |
416 | ||
ba9703b0 | 417 | error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable |
74b04a01 | 418 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:124:29 |
dfeec247 XL |
419 | | |
420 | LL | let ref a @ (ref mut b, ref mut c) = (U, U); | |
421 | | --------------------^^^^^^^^^- | |
422 | | | | | |
423 | | | mutable borrow occurs here | |
424 | | immutable borrow occurs here | |
425 | ... | |
426 | LL | drop(a); | |
427 | | - immutable borrow later used here | |
428 | ||
ba9703b0 | 429 | error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable |
74b04a01 | 430 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:131:18 |
dfeec247 XL |
431 | | |
432 | LL | let ref a @ (ref mut b, ref mut c) = (U, U); | |
433 | | ---------^^^^^^^^^------------ | |
434 | | | | | |
435 | | | mutable borrow occurs here | |
436 | | immutable borrow occurs here | |
437 | ... | |
438 | LL | drop(a); | |
439 | | - immutable borrow later used here | |
440 | ||
ba9703b0 | 441 | error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable |
74b04a01 | 442 | --> $DIR/borrowck-pat-ref-mut-and-ref.rs:131:29 |
dfeec247 XL |
443 | | |
444 | LL | let ref a @ (ref mut b, ref mut c) = (U, U); | |
445 | | --------------------^^^^^^^^^- | |
446 | | | | | |
447 | | | mutable borrow occurs here | |
448 | | immutable borrow occurs here | |
449 | ... | |
450 | LL | drop(a); | |
451 | | - immutable borrow later used here | |
452 | ||
74b04a01 | 453 | error: aborting due to 47 previous errors |
dfeec247 XL |
454 | |
455 | Some errors have detailed explanations: E0502, E0507, E0594. | |
456 | For more information about an error, try `rustc --explain E0502`. |