blob: d443dc9d4831bfb960c4f82d4377b169d91e8e30 [file] [log] [blame]
error[E0507]: cannot move out of `*x` which is behind a shared reference
--> $DIR/move-out-of-ref.rs:9:9
|
LL | fn hello(x: &Ty) {
| --- move occurs because `*x` has type `Ty`, which does not implement the `Copy` trait
LL | let c = async || {
LL | *x;
| ^^ `*x` is moved here
|
note: if `Ty` implemented `Clone`, you could clone the value
--> $DIR/move-out-of-ref.rs:5:1
|
LL | struct Ty;
| ^^^^^^^^^ consider implementing `Clone` for this type
...
LL | *x;
| -- you could clone this value
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0507`.