]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/by-move-pattern-binding.stderr
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
[rust.git] / src / test / ui / by-move-pattern-binding.stderr
index bf1e61fe5543641e10b42df56cd6b318ccf31f54..203e37dc387c1526798c544ae1dec9e3c36b4963 100644 (file)
@@ -32,15 +32,19 @@ LL +     if let E::Bar(identifier) = &s.x {
    |
 
 error[E0507]: cannot move out of a shared reference
-  --> $DIR/by-move-pattern-binding.rs:25:17
+  --> $DIR/by-move-pattern-binding.rs:25:31
    |
 LL |     let &E::Bar(identifier) = &s.x else {
-   |                 ^^^^^^^^^^ move occurs because value has type `String`, which does not implement the `Copy` trait
+   |                 ----------    ^^^^
+   |                 |
+   |                 data moved here
+   |                 move occurs because `identifier` has type `String`, which does not implement the `Copy` trait
+   |
+help: consider removing the borrow
    |
-help: consider borrowing here
+LL -     let &E::Bar(identifier) = &s.x else {
+LL +     let E::Bar(identifier) = &s.x else {
    |
-LL |     let &E::Bar(&identifier) = &s.x else {
-   |                 +
 
 error: aborting due to 3 previous errors