error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-describe-lvalue.rs:295:13 | LL | let y = &mut x; | ------ first mutable borrow occurs here LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time | ^^^^^^ second mutable borrow occurs here LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time LL | *y = 1; | ------ borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-describe-lvalue.rs:307:20 | LL | let y = &mut x; | ------ first mutable borrow occurs here LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time | ^^^^^^ second mutable borrow occurs here LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time LL | *y = 1; | ------ borrow later used here error: unsatisfied lifetime constraints --> $DIR/borrowck-describe-lvalue.rs:305:16 | LL | || { | -- | || | |return type of closure is [closure@$DIR/borrowck-describe-lvalue.rs:305:16: 311:18 x:&'2 mut i32] | lifetime `'1` represents this closure's body LL | / || { //[mir]~ ERROR unsatisfied lifetime constraints LL | | let y = &mut x; LL | | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time LL | | *y = 1; LL | | drop(y); LL | | } | |_________________^ returning this value requires that `'1` must outlive `'2` | = note: closure implements `FnMut`, so references to captured variables can't escape the closure error[E0503]: cannot use `f.x` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:53:9 | LL | let x = f.x(); | - borrow of `f` occurs here LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed | ^^^ use of borrowed `f` LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed LL | drop(x); | - borrow later used here error[E0503]: cannot use `g.0` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:61:9 | LL | let x = g.x(); | - borrow of `g` occurs here LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed | ^^^ use of borrowed `g` LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed LL | drop(x); | - borrow later used here error[E0503]: cannot use `h.0` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:69:9 | LL | let x = &mut h.0; | -------- borrow of `h.0` occurs here LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed | ^^^ use of borrowed `h.0` LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed LL | drop(x); | - borrow later used here error[E0503]: cannot use `e` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:77:15 | LL | let x = e.x(); | - borrow of `e` occurs here LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed | ^ use of borrowed `e` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `e.0` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:78:20 | LL | let x = e.x(); | - borrow of `e` occurs here LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed LL | Baz::X(value) => value | ^^^^^ use of borrowed `e` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `u.a` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:88:9 | LL | let x = &mut u.a; | -------- borrow of `u.a` occurs here LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed | ^^^ use of borrowed `u.a` LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed LL | drop(x); | - borrow later used here error[E0503]: cannot use `f.x` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:96:9 | LL | let x = f.x(); | - borrow of `*f` occurs here LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed | ^^^ use of borrowed `*f` LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed LL | drop(x); | - borrow later used here error[E0503]: cannot use `g.0` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:104:9 | LL | let x = g.x(); | - borrow of `*g` occurs here LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed | ^^^ use of borrowed `*g` LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed LL | drop(x); | - borrow later used here error[E0503]: cannot use `h.0` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:112:9 | LL | let x = &mut h.0; | -------- borrow of `h.0` occurs here LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed | ^^^ use of borrowed `h.0` LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed LL | drop(x); | - borrow later used here error[E0503]: cannot use `*e` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:120:15 | LL | let x = e.x(); | - borrow of `*e` occurs here LL | match *e { //[mir]~ ERROR cannot use `*e` because it was mutably borrowed | ^^ use of borrowed `*e` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `e.0` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:121:20 | LL | let x = e.x(); | - borrow of `*e` occurs here LL | match *e { //[mir]~ ERROR cannot use `*e` because it was mutably borrowed LL | Baz::X(value) => value | ^^^^^ use of borrowed `*e` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `u.a` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:131:9 | LL | let x = &mut u.a; | -------- borrow of `u.a` occurs here LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed | ^^^ use of borrowed `u.a` LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:139:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..]` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:140:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed LL | &[x, _, .., _, _] => println!("{}", x), | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:145:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..]` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:146:18 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | &[_, x, .., _, _] => println!("{}", x), | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:151:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..]` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:152:25 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | &[_, _, .., x, _] => println!("{}", x), | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:157:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..]` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:158:28 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | &[_, _, .., _, x] => println!("{}", x), | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:169:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..]` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:170:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed LL | &[x..] => println!("{:?}", x), | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:175:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..]` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:176:18 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | &[_, x..] => println!("{:?}", x), | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:181:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..]` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:182:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | &[x.., _] => println!("{:?}", x), | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:187:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..]` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:188:18 | LL | let x = &mut v; | ------ borrow of `v` occurs here ... LL | &[_, x.., _] => println!("{:?}", x), | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `e` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:201:15 | LL | let x = &mut e; | ------ borrow of `e` occurs here LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed | ^ use of borrowed `e` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `e` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:202:13 | LL | let x = &mut e; | ------ borrow of `e` occurs here LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed LL | E::A(ref ax) => | ^^^^^^^^^^^^ use of borrowed `e` ... LL | drop(x); | - borrow later used here error[E0502]: cannot borrow `e.0` as immutable because it is also borrowed as mutable --> $DIR/borrowck-describe-lvalue.rs:202:18 | LL | let x = &mut e; | ------ mutable borrow occurs here LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed LL | E::A(ref ax) => | ^^^^^^ immutable borrow occurs here ... LL | drop(x); | - borrow later used here error[E0502]: cannot borrow `e.x` as immutable because it is also borrowed as mutable --> $DIR/borrowck-describe-lvalue.rs:207:23 | LL | let x = &mut e; | ------ mutable borrow occurs here ... LL | E::B { x: ref bx } => | ^^^^^^ immutable borrow occurs here ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `s` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:220:15 | LL | let x = &mut s; | ------ borrow of `s` occurs here LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed | ^ use of borrowed `s` ... LL | drop(x); | - borrow later used here error[E0502]: cannot borrow `s.y.0` as immutable because it is also borrowed as mutable --> $DIR/borrowck-describe-lvalue.rs:221:22 | LL | let x = &mut s; | ------ mutable borrow occurs here LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed LL | S { y: (ref y0, _), .. } => | ^^^^^^ immutable borrow occurs here ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `s` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:227:15 | LL | let x = &mut s; | ------ borrow of `s` occurs here ... LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed | ^ use of borrowed `s` ... LL | drop(x); | - borrow later used here error[E0502]: cannot borrow `s.x.y` as immutable because it is also borrowed as mutable --> $DIR/borrowck-describe-lvalue.rs:228:28 | LL | let x = &mut s; | ------ mutable borrow occurs here ... LL | S { x: F { y: ref x0, .. }, .. } => | ^^^^^^ immutable borrow occurs here ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `*v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:271:9 | LL | let x = &mut v; | ------ borrow of `v` occurs here LL | v[0].y; | ^^^^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[..].y` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:271:9 | LL | let x = &mut v; | ------ borrow of `v` occurs here LL | v[0].y; | ^^^^^^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0503]: cannot use `v` because it was mutably borrowed --> $DIR/borrowck-describe-lvalue.rs:282:15 | LL | let x = &mut v; | ------ borrow of `v` occurs here LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed | ^ use of borrowed `v` ... LL | drop(x); | - borrow later used here error[E0502]: cannot borrow `v[..].x` as immutable because it is also borrowed as mutable --> $DIR/borrowck-describe-lvalue.rs:283:24 | LL | let x = &mut v; | ------ mutable borrow occurs here LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed LL | &[_, F {x: ref xf, ..}] => println!("{}", xf), | ^^^^^^ immutable borrow occurs here ... LL | drop(x); | - borrow later used here error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable --> $DIR/borrowck-describe-lvalue.rs:245:29 | LL | let x = &mut block; | ---------- mutable borrow occurs here LL | let p: &'a u8 = &*block.current; | ^^^^^^^^^^^^^^^ immutable borrow occurs here ... LL | drop(x); | - borrow later used here error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable --> $DIR/borrowck-describe-lvalue.rs:260:33 | LL | let x = &mut block; | ---------- mutable borrow occurs here LL | let p : *const u8 = &*(*block).current; | ^^^^^^^^^^^^^^^^^^ immutable borrow occurs here ... LL | drop(x); | - borrow later used here error[E0382]: use of moved value: `x` --> $DIR/borrowck-describe-lvalue.rs:318:22 | LL | drop(x); | - value moved here LL | drop(x); //[ast]~ ERROR use of moved value: `x` | ^ value used here after move | = note: move occurs because `x` has type `std::vec::Vec`, which does not implement the `Copy` trait error: aborting due to 46 previous errors Some errors occurred: E0382, E0499, E0502, E0503. For more information about an error, try `rustc --explain E0382`.