2019-04-22 08:40:08 +01:00
|
|
|
error[E0382]: borrow of moved value: `x`
|
|
|
|
--> $DIR/borrow-after-move.rs:20:24
|
2018-10-27 17:17:24 +09:00
|
|
|
|
|
|
|
|
LL | let y = *x;
|
2019-04-22 08:40:08 +01:00
|
|
|
| -- value moved here
|
2018-10-27 17:17:24 +09:00
|
|
|
LL | drop_unsized(y);
|
|
|
|
LL | println!("{}", &x);
|
2019-04-22 08:40:08 +01:00
|
|
|
| ^^ value borrowed here after partial move
|
2018-10-27 17:17:24 +09:00
|
|
|
|
|
|
|
|
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
error[E0382]: borrow of moved value: `y`
|
|
|
|
--> $DIR/borrow-after-move.rs:22:24
|
2018-10-27 17:17:24 +09:00
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
LL | let y = *x;
|
|
|
|
| - move occurs because `y` has type `str`, which does not implement the `Copy` trait
|
2018-10-27 17:17:24 +09:00
|
|
|
LL | drop_unsized(y);
|
|
|
|
| - value moved here
|
|
|
|
...
|
|
|
|
LL | println!("{}", &y);
|
2019-04-22 08:40:08 +01:00
|
|
|
| ^^ value borrowed here after move
|
2018-10-27 17:17:24 +09:00
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
error[E0382]: borrow of moved value: `x`
|
|
|
|
--> $DIR/borrow-after-move.rs:30:24
|
2018-10-27 17:17:24 +09:00
|
|
|
|
|
|
|
|
LL | let y = *x;
|
2019-04-22 08:40:08 +01:00
|
|
|
| -- value moved here
|
2018-10-27 17:17:24 +09:00
|
|
|
LL | y.foo();
|
|
|
|
LL | println!("{}", &x);
|
2019-04-22 08:40:08 +01:00
|
|
|
| ^^ value borrowed here after partial move
|
2018-10-27 17:17:24 +09:00
|
|
|
|
|
|
|
|
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
error[E0382]: borrow of moved value: `y`
|
|
|
|
--> $DIR/borrow-after-move.rs:32:24
|
2018-10-27 17:17:24 +09:00
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
LL | let y = *x;
|
|
|
|
| - move occurs because `y` has type `str`, which does not implement the `Copy` trait
|
2018-10-27 17:17:24 +09:00
|
|
|
LL | y.foo();
|
|
|
|
| - value moved here
|
|
|
|
...
|
|
|
|
LL | println!("{}", &y);
|
2019-04-22 08:40:08 +01:00
|
|
|
| ^^ value borrowed here after move
|
2018-10-27 17:17:24 +09:00
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
error[E0382]: borrow of moved value: `x`
|
|
|
|
--> $DIR/borrow-after-move.rs:39:24
|
2018-10-27 17:17:24 +09:00
|
|
|
|
|
|
|
|
LL | x.foo();
|
|
|
|
| - value moved here
|
|
|
|
LL | println!("{}", &x);
|
2019-04-22 08:40:08 +01:00
|
|
|
| ^^ value borrowed here after partial move
|
2018-10-27 17:17:24 +09:00
|
|
|
|
|
|
|
|
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|