| -- value moved here
LL | drop_unsized(y);
LL | println!("{}", &x);
- | ^^ value borrowed here after partial move
+ | ^^ value borrowed here after move
|
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
| -- value moved here
LL | y.foo();
LL | println!("{}", &x);
- | ^^ value borrowed here after partial move
+ | ^^ value borrowed 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 | println!("{}", &y);
| ^^ value borrowed here after move
+ |
+note: this function consumes the receiver `self` by taking ownership of it, which moves `y`
+ --> $DIR/borrow-after-move.rs:4:12
+ |
+LL | fn foo(self) -> String;
+ | ^^^^
error[E0382]: borrow of moved value: `x`
--> $DIR/borrow-after-move.rs:39:24