fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
624 B16 linesraw
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 `std::string::String`, which does not implement the `Copy` trait
12   |         help: consider removing the `&`: `E::Bar(identifier)`
13
14error: aborting due to previous error
15
16For more information about this error, try `rustc --explain E0507`.