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 error: unsatisfied lifetime constraints
24 --> $DIR/borrowck-describe-lvalue.rs:305:16
29 | |return type of closure is [closure@$DIR/borrowck-describe-lvalue.rs:305:16: 311:18 x:&'2 mut i32]
30 | lifetime `'1` represents this closure's body
31 LL | / || { //[mir]~ ERROR unsatisfied lifetime constraints
32 LL | | let y = &mut x;
33 LL | | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
34 LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time
38 | |_________________^ returning this value requires that `'1` must outlive `'2`
40 = note: closure implements `FnMut`, so references to captured variables can't escape the closure
42 error[E0503]: cannot use `f.x` because it was mutably borrowed
43 --> $DIR/borrowck-describe-lvalue.rs:53:9
46 | - borrow of `f` occurs here
47 LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
48 | ^^^ use of borrowed `f`
49 LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed
51 | - borrow later used here
53 error[E0503]: cannot use `g.0` because it was mutably borrowed
54 --> $DIR/borrowck-describe-lvalue.rs:61:9
57 | - borrow of `g` occurs here
58 LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
59 | ^^^ use of borrowed `g`
60 LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed
62 | - borrow later used here
64 error[E0503]: cannot use `h.0` because it was mutably borrowed
65 --> $DIR/borrowck-describe-lvalue.rs:69:9
67 LL | let x = &mut h.0;
68 | -------- borrow of `h.0` occurs here
69 LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
70 | ^^^ use of borrowed `h.0`
71 LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed
73 | - borrow later used here
75 error[E0503]: cannot use `e.0` because it was mutably borrowed
76 --> $DIR/borrowck-describe-lvalue.rs:78:20
79 | - borrow of `e` occurs here
81 LL | Baz::X(value) => value
82 | ^^^^^ use of borrowed `e`
85 | - borrow later used here
87 error[E0503]: cannot use `u.a` because it was mutably borrowed
88 --> $DIR/borrowck-describe-lvalue.rs:88:9
90 LL | let x = &mut u.a;
91 | -------- borrow of `u.a` occurs here
92 LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
93 | ^^^ use of borrowed `u.a`
94 LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
96 | - borrow later used here
98 error[E0503]: cannot use `f.x` because it was mutably borrowed
99 --> $DIR/borrowck-describe-lvalue.rs:96:9
102 | - borrow of `*f` occurs here
103 LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
104 | ^^^ use of borrowed `*f`
105 LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed
107 | - borrow later used here
109 error[E0503]: cannot use `g.0` because it was mutably borrowed
110 --> $DIR/borrowck-describe-lvalue.rs:104:9
113 | - borrow of `*g` occurs here
114 LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
115 | ^^^ use of borrowed `*g`
116 LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed
118 | - borrow later used here
120 error[E0503]: cannot use `h.0` because it was mutably borrowed
121 --> $DIR/borrowck-describe-lvalue.rs:112:9
123 LL | let x = &mut h.0;
124 | -------- borrow of `h.0` occurs here
125 LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
126 | ^^^ use of borrowed `h.0`
127 LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed
129 | - borrow later used here
131 error[E0503]: cannot use `e.0` because it was mutably borrowed
132 --> $DIR/borrowck-describe-lvalue.rs:121:20
135 | - borrow of `*e` occurs here
137 LL | Baz::X(value) => value
138 | ^^^^^ use of borrowed `*e`
141 | - borrow later used here
143 error[E0503]: cannot use `u.a` because it was mutably borrowed
144 --> $DIR/borrowck-describe-lvalue.rs:131:9
146 LL | let x = &mut u.a;
147 | -------- borrow of `u.a` occurs here
148 LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
149 | ^^^ use of borrowed `u.a`
150 LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed
152 | - borrow later used here
154 error[E0503]: cannot use `v[..]` because it was mutably borrowed
155 --> $DIR/borrowck-describe-lvalue.rs:140:15
158 | ------ borrow of `v` occurs here
160 LL | &[x, _, .., _, _] => println!("{}", x),
161 | ^ use of borrowed `v`
164 | - borrow later used here
166 error[E0503]: cannot use `v[..]` because it was mutably borrowed
167 --> $DIR/borrowck-describe-lvalue.rs:146:18
170 | ------ borrow of `v` occurs here
172 LL | &[_, x, .., _, _] => println!("{}", x),
173 | ^ use of borrowed `v`
176 | - borrow later used here
178 error[E0503]: cannot use `v[..]` because it was mutably borrowed
179 --> $DIR/borrowck-describe-lvalue.rs:152:25
182 | ------ borrow of `v` occurs here
184 LL | &[_, _, .., x, _] => println!("{}", x),
185 | ^ use of borrowed `v`
188 | - borrow later used here
190 error[E0503]: cannot use `v[..]` because it was mutably borrowed
191 --> $DIR/borrowck-describe-lvalue.rs:158:28
194 | ------ borrow of `v` occurs here
196 LL | &[_, _, .., _, x] => println!("{}", x),
197 | ^ use of borrowed `v`
200 | - borrow later used here
202 error[E0503]: cannot use `v[..]` because it was mutably borrowed
203 --> $DIR/borrowck-describe-lvalue.rs:170:15
206 | ------ borrow of `v` occurs here
208 LL | &[x..] => println!("{:?}", x),
209 | ^ use of borrowed `v`
212 | - borrow later used here
214 error[E0503]: cannot use `v[..]` because it was mutably borrowed
215 --> $DIR/borrowck-describe-lvalue.rs:176:18
218 | ------ borrow of `v` occurs here
220 LL | &[_, x..] => println!("{:?}", x),
221 | ^ use of borrowed `v`
224 | - borrow later used here
226 error[E0503]: cannot use `v[..]` because it was mutably borrowed
227 --> $DIR/borrowck-describe-lvalue.rs:182:15
230 | ------ borrow of `v` occurs here
232 LL | &[x.., _] => println!("{:?}", x),
233 | ^ use of borrowed `v`
236 | - borrow later used here
238 error[E0503]: cannot use `v[..]` because it was mutably borrowed
239 --> $DIR/borrowck-describe-lvalue.rs:188:18
242 | ------ borrow of `v` occurs here
244 LL | &[_, x.., _] => println!("{:?}", x),
245 | ^ use of borrowed `v`
248 | - borrow later used here
250 error[E0503]: cannot use `e` because it was mutably borrowed
251 --> $DIR/borrowck-describe-lvalue.rs:202:13
254 | ------ borrow of `e` occurs here
257 | ^^^^^^^^^^^^ use of borrowed `e`
260 | - borrow later used here
262 error[E0502]: cannot borrow `e.0` as immutable because it is also borrowed as mutable
263 --> $DIR/borrowck-describe-lvalue.rs:202:18
266 | ------ mutable borrow occurs here
269 | ^^^^^^ immutable borrow occurs here
272 | - mutable borrow later used here
274 error[E0502]: cannot borrow `e.x` as immutable because it is also borrowed as mutable
275 --> $DIR/borrowck-describe-lvalue.rs:207:23
278 | ------ mutable borrow occurs here
280 LL | E::B { x: ref bx } =>
281 | ^^^^^^ immutable borrow occurs here
284 | - mutable borrow later used here
286 error[E0502]: cannot borrow `s.y.0` as immutable because it is also borrowed as mutable
287 --> $DIR/borrowck-describe-lvalue.rs:221:22
290 | ------ mutable borrow occurs here
292 LL | S { y: (ref y0, _), .. } =>
293 | ^^^^^^ immutable borrow occurs here
296 | - mutable borrow later used here
298 error[E0502]: cannot borrow `s.x.y` as immutable because it is also borrowed as mutable
299 --> $DIR/borrowck-describe-lvalue.rs:228:28
302 | ------ mutable borrow occurs here
304 LL | S { x: F { y: ref x0, .. }, .. } =>
305 | ^^^^^^ immutable borrow occurs here
308 | - mutable borrow later used here
310 error[E0503]: cannot use `*v` because it was mutably borrowed
311 --> $DIR/borrowck-describe-lvalue.rs:271:9
314 | ------ borrow of `v` occurs here
316 | ^^^^ use of borrowed `v`
319 | - borrow later used here
321 error[E0503]: cannot use `v[..].y` because it was mutably borrowed
322 --> $DIR/borrowck-describe-lvalue.rs:271:9
325 | ------ borrow of `v` occurs here
327 | ^^^^^^ use of borrowed `v`
330 | - borrow later used here
332 error[E0502]: cannot borrow `v[..].x` as immutable because it is also borrowed as mutable
333 --> $DIR/borrowck-describe-lvalue.rs:283:24
336 | ------ mutable borrow occurs here
338 LL | &[_, F {x: ref xf, ..}] => println!("{}", xf),
339 | ^^^^^^ immutable borrow occurs here
342 | - mutable borrow later used here
344 error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
345 --> $DIR/borrowck-describe-lvalue.rs:245:29
347 LL | let x = &mut block;
348 | ---------- mutable borrow occurs here
349 LL | let p: &'a u8 = &*block.current;
350 | ^^^^^^^^^^^^^^^ immutable borrow occurs here
353 | - mutable borrow later used here
355 error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
356 --> $DIR/borrowck-describe-lvalue.rs:260:33
358 LL | let x = &mut block;
359 | ---------- mutable borrow occurs here
360 LL | let p : *const u8 = &*(*block).current;
361 | ^^^^^^^^^^^^^^^^^^ immutable borrow occurs here
364 | - mutable borrow later used here
366 error[E0382]: use of moved value: `x`
367 --> $DIR/borrowck-describe-lvalue.rs:318:22
371 LL | drop(x); //[ast]~ ERROR use of moved value: `x`
372 | ^ value used here after move
374 = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
376 error: aborting due to 32 previous errors
378 Some errors occurred: E0382, E0499, E0502, E0503.
379 For more information about an error, try `rustc --explain E0382`.