about summary refs log tree commit diff
path: root/src/test/ui/by-move-pattern-binding.stderr
blob: 8b531474553d22cdaf843527b27c5e2a44446d1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
error[E0507]: cannot move out of borrowed content
  --> $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
   |         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

For more information about this error, try `rustc --explain E0507`.