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