-error[E0507]: cannot move out of borrowed content
+error[E0507]: cannot move out of a shared reference
--> $DIR/by-move-pattern-binding.rs:14:11
|
LL | match &s.x {
- | ^^^^ cannot move out of borrowed content
+ | ^^^^
LL | &E::Foo => {}
LL | &E::Bar(identifier) => f(identifier.clone())
| -------------------
| | |
| | data moved here
+ | | move occurs because `identifier` has type `std::string::String`, which does not implement the `Copy` trait
| 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())
- | ^^^^^^^^^^
error: aborting due to previous error