2019-05-05 11:02:32 +00:00
|
|
|
error[E0507]: cannot move out of `*x` which is behind a shared reference
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-fn-in-const-a.rs:6:16
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | return *x
|
2020-09-02 07:40:56 +00:00
|
|
|
| ^^ move occurs because `*x` has type `String`, which does not implement the `Copy` trait
|
2024-03-13 03:41:41 +00:00
|
|
|
|
|
|
|
|
help: consider cloning the value if the performance cost is acceptable
|
|
|
|
|
|
|
|
|
LL - return *x
|
|
|
|
LL + return x.clone()
|
|
|
|
|
|
2018-08-08 12:28:26 +00:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0507`.
|