]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/by-move-pattern-binding.nll.stderr
Bless tests
[rust.git] / src / test / ui / by-move-pattern-binding.nll.stderr
index 4ba9b3aeb5d5da423591f7b3554db573cdaad917..491b5b5bd74abef53a40f7b6d0e963f9c0683bd5 100644 (file)
@@ -5,10 +5,16 @@ 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: to prevent move, use ref or ref mut: `ref identifier`
+   |         -------------------
+   |         |       |
+   |         |       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: aborting due to previous error