]> git.lizzy.rs Git - rust.git/blob - src/test/ui/by-move-pattern-binding.nll.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / by-move-pattern-binding.nll.stderr
1 error[E0507]: cannot move out of borrowed content
2   --> $DIR/by-move-pattern-binding.rs:14:11
3    |
4 LL |     match &s.x {
5    |           ^^^^ cannot move out of borrowed content
6 LL |         &E::Foo => {}
7 LL |         &E::Bar(identifier) => f(identifier.clone())  //~ ERROR cannot move
8    |         -------------------
9    |         |       |
10    |         |       data moved here
11    |         help: consider removing the `&`: `E::Bar(identifier)`
12    |
13 note: move occurs because `identifier` has type `std::string::String`, which does not implement the `Copy` trait
14   --> $DIR/by-move-pattern-binding.rs:16:17
15    |
16 LL |         &E::Bar(identifier) => f(identifier.clone())  //~ ERROR cannot move
17    |                 ^^^^^^^^^^
18
19 error: aborting due to previous error
20
21 For more information about this error, try `rustc --explain E0507`.