rust/src/test/ui/borrowck/borrowck-use-mut-borrow.stderr

76 lines
2.9 KiB
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0503]: cannot use `x` because it was mutably borrowed
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:11:10
2018-08-08 07:28:26 -05:00
|
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
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:18:10
2018-08-08 07:28:26 -05:00
|
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
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:25:10
2018-08-08 07:28:26 -05:00
|
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
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:32:10
2018-08-08 07:28:26 -05:00
|
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
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:39:26
2018-08-08 07:28:26 -05:00
|
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
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:47:26
2018-08-08 07:28:26 -05:00
|
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
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:55:10
2018-08-08 07:28:26 -05:00
|
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
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:62:10
2018-08-08 07:28:26 -05:00
|
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
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-use-mut-borrow.rs:69:10
2018-08-08 07:28:26 -05:00
|
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`.