blob: c5bfd813a791e7a030804206549ea88a9d418449 [file] [log] [blame]
error[E0503]: cannot use `x` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:21:10
|
LL | let p = &mut x;
| - borrow of `x` occurs here
LL | drop(x); //~ ERROR cannot use `x` because it was mutably borrowed
| ^ use of borrowed `x`
error[E0503]: cannot use `x` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:28:10
|
LL | let p = &mut x.a;
| --- borrow of `x.a` occurs here
LL | drop(x); //~ ERROR cannot use `x` because it was mutably borrowed
| ^ use of borrowed `x.a`
error[E0503]: cannot use `x.a` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:35:10
|
LL | let p = &mut x;
| - borrow of `x` occurs here
LL | drop(x.a); //~ ERROR cannot use `x.a` because it was mutably borrowed
| ^^^ use of borrowed `x`
error[E0503]: cannot use `x.a` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:42:10
|
LL | let p = &mut x.a;
| --- borrow of `x.a` occurs here
LL | drop(x.a); //~ ERROR cannot use `x.a` because it was mutably borrowed
| ^^^ use of borrowed `x.a`
error[E0503]: cannot use `x.a` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:49:26
|
LL | let p = &mut x;
| - borrow of `x` occurs here
LL | let y = A { b: 3, .. x }; //~ ERROR cannot use `x.a` because it was mutably borrowed
| ^ use of borrowed `x`
error[E0503]: cannot use `x.a` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:57:26
|
LL | let p = &mut x.a;
| --- borrow of `x.a` occurs here
LL | let y = A { b: 3, .. x }; //~ ERROR cannot use `x.a` because it was mutably borrowed
| ^ use of borrowed `x.a`
error[E0503]: cannot use `*x` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:65:10
|
LL | let p = &mut x;
| - borrow of `x` occurs here
LL | drop(*x); //~ ERROR cannot use `*x` because it was mutably borrowed
| ^^ use of borrowed `x`
error[E0503]: cannot use `*x.b` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:72:10
|
LL | let p = &mut x;
| - borrow of `x` occurs here
LL | drop(*x.b); //~ ERROR cannot use `*x.b` because it was mutably borrowed
| ^^^^ use of borrowed `x`
error[E0503]: cannot use `*x.b` because it was mutably borrowed
--> $DIR/borrowck-use-mut-borrow.rs:79:10
|
LL | let p = &mut x.b;
| --- borrow of `x.b` occurs here
LL | drop(*x.b); //~ ERROR cannot use `*x.b` because it was mutably borrowed
| ^^^^ use of borrowed `x.b`
error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0503`.