blob: 40987958115895deb46cf043e85040f6516de69d [file] [log] [blame]
error[E0507]: cannot move out of borrowed content
--> $DIR/by-move-pattern-binding.rs:24:11
|
LL | match &s.x {
| ^^^^ cannot move out of borrowed content
LL | &E::Foo => {}
LL | &E::Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move
| -------------------
| | |
| | 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:26:17
|
LL | &E::Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move
| ^^^^^^^^^^
error[E0507]: cannot move out of data in a `&` reference
--> $DIR/by-move-pattern-binding.rs:26:17
|
LL | &E::Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move
| ^^^^^^^^^^
| |
| cannot move out of data in a `&` reference
| cannot move
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0507`.