fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0507]: cannot move out of a shared reference 2 --> $DIR/by-move-pattern-binding.rs:14:11 3 | 4LL | match &s.x { 5 | ^^^^ 6LL | &E::Foo => {} 7LL | &E::Bar(identifier) => f(identifier.clone()) 8 | ---------- 9 | | 10 | data moved here 11 | move occurs because `identifier` has type `String`, which does not implement the `Copy` trait 12 | 13help: consider removing the borrow 14 | 15LL - &E::Bar(identifier) => f(identifier.clone()) 16LL + E::Bar(identifier) => f(identifier.clone()) 17 | 18 19error[E0507]: cannot move out of a shared reference 20 --> $DIR/by-move-pattern-binding.rs:22:34 21 | 22LL | if let &E::Bar(identifier) = &s.x { 23 | ---------- ^^^^ 24 | | 25 | data moved here 26 | move occurs because `identifier` has type `String`, which does not implement the `Copy` trait 27 | 28help: consider removing the borrow 29 | 30LL - if let &E::Bar(identifier) = &s.x { 31LL + if let E::Bar(identifier) = &s.x { 32 | 33 34error[E0507]: cannot move out of a shared reference 35 --> $DIR/by-move-pattern-binding.rs:25:31 36 | 37LL | let &E::Bar(identifier) = &s.x else { 38 | ---------- ^^^^ 39 | | 40 | data moved here 41 | move occurs because `identifier` has type `String`, which does not implement the `Copy` trait 42 | 43help: consider removing the borrow 44 | 45LL - let &E::Bar(identifier) = &s.x else { 46LL + let E::Bar(identifier) = &s.x else { 47 | 48 49error: aborting due to 3 previous errors 50 51For more information about this error, try `rustc --explain E0507`.