2018-08-08 12:28:26 +00:00
|
|
|
error[E0382]: use of moved value: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-move-semantics.rs:8:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | x
|
|
|
|
| - value moved here
|
|
|
|
LL | +
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^ value used here after move
|
|
|
|
|
|
|
|
|
= note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
|
|
|
|
|
|
|
|
error[E0382]: use of moved value: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-move-semantics.rs:14:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | x
|
|
|
|
| - value moved here
|
|
|
|
LL | +
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x.clone();
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^ value used here after move
|
|
|
|
|
|
|
|
|
= note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
|
|
|
|
|
|
|
|
error[E0505]: cannot move out of `x` because it is borrowed
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-move-semantics.rs:21:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let m = &x;
|
|
|
|
| - borrow of `x` occurs here
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^ move out of `x` occurs here
|
|
|
|
|
|
|
|
error[E0505]: cannot move out of `y` because it is borrowed
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-move-semantics.rs:23:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let n = &mut y;
|
|
|
|
| - borrow of `y` occurs here
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | y;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^ move out of `y` occurs here
|
|
|
|
|
|
|
|
error[E0507]: cannot move out of borrowed content
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-move-semantics.rs:30:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | *m
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^ cannot move out of borrowed content
|
|
|
|
|
|
|
|
error[E0507]: cannot move out of borrowed content
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-move-semantics.rs:32:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | *n;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^ cannot move out of borrowed content
|
|
|
|
|
|
|
|
error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-move-semantics.rs:54:6
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | &mut f
|
|
|
|
| - mutable borrow occurs here
|
|
|
|
LL | +
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &f;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^
|
|
|
|
| |
|
|
|
|
| immutable borrow occurs here
|
|
|
|
| mutable borrow ends here
|
|
|
|
|
|
|
|
error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immutable
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/binop-move-semantics.rs:62:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | &f
|
|
|
|
| - immutable borrow occurs here
|
|
|
|
LL | +
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut f;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^
|
|
|
|
| |
|
|
|
|
| mutable borrow occurs here
|
|
|
|
| immutable borrow ends here
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
|
|
|
|
|
|
|
Some errors occurred: E0382, E0502, E0505, E0507.
|
|
|
|
For more information about an error, try `rustc --explain E0382`.
|