2018-08-08 14:28:26 +02:00
|
|
|
error[E0507]: cannot move out of borrowed content
|
2019-04-22 08:40:08 +01:00
|
|
|
--> $DIR/by-move-pattern-binding.rs:14:11
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
LL | match &s.x {
|
|
|
|
| ^^^^ cannot move out of borrowed content
|
|
|
|
LL | &E::Foo => {}
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | &E::Bar(identifier) => f(identifier.clone())
|
2019-04-22 08:40:08 +01:00
|
|
|
| -------------------
|
2018-08-08 14:28:26 +02:00
|
|
|
| | |
|
2019-04-22 08:40:08 +01:00
|
|
|
| | data moved here
|
|
|
|
| help: consider removing the `&`: `E::Bar(identifier)`
|
|
|
|
|
|
|
|
|
note: move occurs because `identifier` has type `std::string::String`, which does not implement the `Copy` trait
|
|
|
|
--> $DIR/by-move-pattern-binding.rs:16:17
|
|
|
|
|
|
|
|
|
LL | &E::Bar(identifier) => f(identifier.clone())
|
|
|
|
| ^^^^^^^^^^
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0507`.
|