mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 18:57:19 +00:00

``` error[E0507]: cannot move out of `*x` which is behind a shared reference --> $DIR/borrowck-fn-in-const-a.rs:6:16 | LL | return *x | ^^ move occurs because `*x` has type `String`, which does not implement the `Copy` trait | help: consider cloning the value if the performance cost is acceptable | LL - return *x LL + return x.clone() | ```
18 lines
679 B
Plaintext
18 lines
679 B
Plaintext
error[E0509]: cannot move out of type `A`, which implements the `Drop` trait
|
|
--> $DIR/functional-struct-update-noncopyable.rs:12:14
|
|
|
|
|
LL | let _b = A { y: Arc::new(3), ..a };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| cannot move out of here
|
|
| move occurs because `a.x` has type `Arc<isize>`, which does not implement the `Copy` trait
|
|
|
|
|
help: clone the value to increment its reference count
|
|
|
|
|
LL | let _b = A { y: Arc::new(3), ..a }.clone();
|
|
| ++++++++
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0509`.
|