LL | let _y = *x;
| -- value moved here
LL | drop_unsized(x);
- | ^ value used here after partial move
+ | ^ value used here after move
|
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
LL | let y = *x;
| - move occurs because `y` has type `str`, which does not implement the `Copy` trait
LL | y.foo();
- | - value moved here
+ | ----- `y` moved due to this method call
LL | y.foo();
| ^ value used here after move
+ |
+note: this function consumes the receiver `self` by taking ownership of it, which moves `y`
+ --> $DIR/double-move.rs:4:12
+ |
+LL | fn foo(self) -> String;
+ | ^^^^
error[E0382]: use of moved value: `x`
--> $DIR/double-move.rs:45:9
LL | let _y = *x;
| -- value moved here
LL | x.foo();
- | ^ value used here after partial move
+ | ^ value used here after move
|
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait