1 error[E0499]: cannot borrow `x` as mutable more than once at a time
2 --> $DIR/borrowck-describe-lvalue.rs:295:13
5 | ------ first mutable borrow occurs here
6 LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
7 | ^^^^^^ second mutable borrow occurs here
8 LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
10 | ------ first borrow later used here
12 error[E0499]: cannot borrow `x` as mutable more than once at a time
13 --> $DIR/borrowck-describe-lvalue.rs:307:20
16 | ------ first mutable borrow occurs here
17 LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
18 | ^^^^^^ second mutable borrow occurs here
19 LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
21 | ------ first borrow later used here
23 warning: captured variable cannot escape `FnMut` closure body
24 --> $DIR/borrowck-describe-lvalue.rs:305:16
27 | - inferred to be a `FnMut` closure
28 LL | / || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body
29 LL | | let y = &mut x;
30 LL | | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
31 LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
35 | |_________________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
37 = note: `FnMut` closures only have access to their captured variables while they are executing...
38 = note: ...therefore, they cannot allow references to captured variables to escape
39 = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
40 It represents potential unsoundness in your code.
41 This warning will become a hard error in the future.
43 error[E0503]: cannot use `f.x` because it was mutably borrowed
44 --> $DIR/borrowck-describe-lvalue.rs:53:9
47 | - borrow of `f` occurs here
48 LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
49 | ^^^ use of borrowed `f`
50 LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed
52 | - borrow later used here
54 error[E0503]: cannot use `g.0` because it was mutably borrowed
55 --> $DIR/borrowck-describe-lvalue.rs:61:9
58 | - borrow of `g` occurs here
59 LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
60 | ^^^ use of borrowed `g`
61 LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed
63 | - borrow later used here
65 error[E0503]: cannot use `h.0` because it was mutably borrowed
66 --> $DIR/borrowck-describe-lvalue.rs:69:9
68 LL | let x = &mut h.0;
69 | -------- borrow of `h.0` occurs here
70 LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
71 | ^^^ use of borrowed `h.0`
72 LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed
74 | - borrow later used here
76 error[E0503]: cannot use `e.0` because it was mutably borrowed
77 --> $DIR/borrowck-describe-lvalue.rs:78:20
80 | - borrow of `e` occurs here
82 LL | Baz::X(value) => value
83 | ^^^^^ use of borrowed `e`
86 | - borrow later used here
88 error[E0503]: cannot use `u.a` because it was mutably borrowed
89 --> $DIR/borrowck-describe-lvalue.rs:88:9
91 LL | let x = &mut u.a;
92 | -------- borrow of `u.a` occurs here
93 LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
94 | ^^^ use of borrowed `u.a`
95 LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
97 | - borrow later used here
99 error[E0503]: cannot use `f.x` because it was mutably borrowed
100 --> $DIR/borrowck-describe-lvalue.rs:96:9
103 | - borrow of `*f` occurs here
104 LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
105 | ^^^ use of borrowed `*f`
106 LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed
108 | - borrow later used here
110 error[E0503]: cannot use `g.0` because it was mutably borrowed
111 --> $DIR/borrowck-describe-lvalue.rs:104:9
114 | - borrow of `*g` occurs here
115 LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
116 | ^^^ use of borrowed `*g`
117 LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed
119 | - borrow later used here
121 error[E0503]: cannot use `h.0` because it was mutably borrowed
122 --> $DIR/borrowck-describe-lvalue.rs:112:9
124 LL | let x = &mut h.0;
125 | -------- borrow of `h.0` occurs here
126 LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
127 | ^^^ use of borrowed `h.0`
128 LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed
130 | - borrow later used here
132 error[E0503]: cannot use `e.0` because it was mutably borrowed
133 --> $DIR/borrowck-describe-lvalue.rs:121:20
136 | - borrow of `*e` occurs here
138 LL | Baz::X(value) => value
139 | ^^^^^ use of borrowed `*e`
142 | - borrow later used here
144 error[E0503]: cannot use `u.a` because it was mutably borrowed
145 --> $DIR/borrowck-describe-lvalue.rs:131:9
147 LL | let x = &mut u.a;
148 | -------- borrow of `u.a` occurs here
149 LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
150 | ^^^ use of borrowed `u.a`
151 LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
153 | - borrow later used here
155 error[E0503]: cannot use `v[..]` because it was mutably borrowed
156 --> $DIR/borrowck-describe-lvalue.rs:140:15
159 | ------ borrow of `v` occurs here
161 LL | &[x, _, .., _, _] => println!("{}", x),
162 | ^ use of borrowed `v`
165 | - borrow later used here
167 error[E0503]: cannot use `v[..]` because it was mutably borrowed
168 --> $DIR/borrowck-describe-lvalue.rs:146:18
171 | ------ borrow of `v` occurs here
173 LL | &[_, x, .., _, _] => println!("{}", x),
174 | ^ use of borrowed `v`
177 | - borrow later used here
179 error[E0503]: cannot use `v[..]` because it was mutably borrowed
180 --> $DIR/borrowck-describe-lvalue.rs:152:25
183 | ------ borrow of `v` occurs here
185 LL | &[_, _, .., x, _] => println!("{}", x),
186 | ^ use of borrowed `v`
189 | - borrow later used here
191 error[E0503]: cannot use `v[..]` because it was mutably borrowed
192 --> $DIR/borrowck-describe-lvalue.rs:158:28
195 | ------ borrow of `v` occurs here
197 LL | &[_, _, .., _, x] => println!("{}", x),
198 | ^ use of borrowed `v`
201 | - borrow later used here
203 error[E0503]: cannot use `v[..]` because it was mutably borrowed
204 --> $DIR/borrowck-describe-lvalue.rs:170:15
207 | ------ borrow of `v` occurs here
209 LL | &[x..] => println!("{:?}", x),
210 | ^ use of borrowed `v`
213 | - borrow later used here
215 error[E0503]: cannot use `v[..]` because it was mutably borrowed
216 --> $DIR/borrowck-describe-lvalue.rs:176:18
219 | ------ borrow of `v` occurs here
221 LL | &[_, x..] => println!("{:?}", x),
222 | ^ use of borrowed `v`
225 | - borrow later used here
227 error[E0503]: cannot use `v[..]` because it was mutably borrowed
228 --> $DIR/borrowck-describe-lvalue.rs:182:15
231 | ------ borrow of `v` occurs here
233 LL | &[x.., _] => println!("{:?}", x),
234 | ^ use of borrowed `v`
237 | - borrow later used here
239 error[E0503]: cannot use `v[..]` because it was mutably borrowed
240 --> $DIR/borrowck-describe-lvalue.rs:188:18
243 | ------ borrow of `v` occurs here
245 LL | &[_, x.., _] => println!("{:?}", x),
246 | ^ use of borrowed `v`
249 | - borrow later used here
251 error[E0503]: cannot use `e` because it was mutably borrowed
252 --> $DIR/borrowck-describe-lvalue.rs:202:13
255 | ------ borrow of `e` occurs here
258 | ^^^^^^^^^^^^ use of borrowed `e`
261 | - borrow later used here
263 error[E0502]: cannot borrow `e.0` as immutable because it is also borrowed as mutable
264 --> $DIR/borrowck-describe-lvalue.rs:202:18
267 | ------ mutable borrow occurs here
270 | ^^^^^^ immutable borrow occurs here
273 | - mutable borrow later used here
275 error[E0502]: cannot borrow `e.x` as immutable because it is also borrowed as mutable
276 --> $DIR/borrowck-describe-lvalue.rs:207:23
279 | ------ mutable borrow occurs here
281 LL | E::B { x: ref bx } =>
282 | ^^^^^^ immutable borrow occurs here
285 | - mutable borrow later used here
287 error[E0502]: cannot borrow `s.y.0` as immutable because it is also borrowed as mutable
288 --> $DIR/borrowck-describe-lvalue.rs:221:22
291 | ------ mutable borrow occurs here
293 LL | S { y: (ref y0, _), .. } =>
294 | ^^^^^^ immutable borrow occurs here
297 | - mutable borrow later used here
299 error[E0502]: cannot borrow `s.x.y` as immutable because it is also borrowed as mutable
300 --> $DIR/borrowck-describe-lvalue.rs:228:28
303 | ------ mutable borrow occurs here
305 LL | S { x: F { y: ref x0, .. }, .. } =>
306 | ^^^^^^ immutable borrow occurs here
309 | - mutable borrow later used here
311 error[E0503]: cannot use `*v` because it was mutably borrowed
312 --> $DIR/borrowck-describe-lvalue.rs:271:9
315 | ------ borrow of `v` occurs here
317 | ^^^^ use of borrowed `v`
320 | - borrow later used here
322 error[E0503]: cannot use `v[..].y` because it was mutably borrowed
323 --> $DIR/borrowck-describe-lvalue.rs:271:9
326 | ------ borrow of `v` occurs here
328 | ^^^^^^ use of borrowed `v`
331 | - borrow later used here
333 error[E0502]: cannot borrow `v[..].x` as immutable because it is also borrowed as mutable
334 --> $DIR/borrowck-describe-lvalue.rs:283:24
337 | ------ mutable borrow occurs here
339 LL | &[_, F {x: ref xf, ..}] => println!("{}", xf),
340 | ^^^^^^ immutable borrow occurs here
343 | - mutable borrow later used here
345 warning[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
346 --> $DIR/borrowck-describe-lvalue.rs:245:29
348 LL | let x = &mut block;
349 | ---------- mutable borrow occurs here
350 LL | let p: &'a u8 = &*block.current;
351 | ^^^^^^^^^^^^^^^ immutable borrow occurs here
354 | - mutable borrow later used here
356 = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
357 It represents potential unsoundness in your code.
358 This warning will become a hard error in the future.
360 warning[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
361 --> $DIR/borrowck-describe-lvalue.rs:260:33
363 LL | let x = &mut block;
364 | ---------- mutable borrow occurs here
365 LL | let p : *const u8 = &*(*block).current;
366 | ^^^^^^^^^^^^^^^^^^ immutable borrow occurs here
369 | - mutable borrow later used here
371 = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
372 It represents potential unsoundness in your code.
373 This warning will become a hard error in the future.
375 error[E0382]: use of moved value: `x`
376 --> $DIR/borrowck-describe-lvalue.rs:318:22
380 LL | drop(x); //[ast]~ ERROR use of moved value: `x`
381 | ^ value used here after move
383 = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
385 error: aborting due to 29 previous errors
387 Some errors occurred: E0382, E0499, E0502, E0503.
388 For more information about an error, try `rustc --explain E0382`.