]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/by-move-pattern-binding.stderr
Update tests for changes to cannot move errors
[rust.git] / src / test / ui / by-move-pattern-binding.stderr
index 5135e0dadaf9dab5f0c1a32c205d8bb56ff8bc52..1db4e2a66dbde7ed387deaf85f3144d57432916b 100644 (file)
@@ -1,11 +1,15 @@
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/by-move-pattern-binding.rs:16:9
+error[E0507]: cannot move out of a shared reference
+  --> $DIR/by-move-pattern-binding.rs:14:11
    |
+LL |     match &s.x {
+   |           ^^^^
+LL |         &E::Foo => {}
 LL |         &E::Bar(identifier) => f(identifier.clone())
-   |         ^^^^^^^^----------^
+   |         -------------------
    |         |       |
-   |         |       hint: to prevent move, use `ref identifier` or `ref mut identifier`
-   |         cannot move out of borrowed content
+   |         |       data moved here
+   |         |       move occurs because `identifier` has type `std::string::String`, which does not implement the `Copy` trait
+   |         help: consider removing the `&`: `E::Bar(identifier)`
 
 error: aborting due to previous error