summaryrefslogtreecommitdiffstats
path: root/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr')
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
index 384a57b2e..ad4ce7952 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
@@ -97,6 +97,11 @@ LL | let a @ (ref mut b, ref mut c) = (U, U);
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
+ |
+help: borrow this binding in the pattern to avoid moving the value
+ |
+LL | let ref a @ (ref mut b, ref mut c) = (U, U);
+ | +++
error: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-twice.rs:67:9
@@ -109,6 +114,11 @@ LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `&mut (U, [U; 2])` which does not implement the `Copy` trait
+ |
+help: borrow this binding in the pattern to avoid moving the value
+ |
+LL | let ref a @ (b, [c, d]) = &mut val; // Same as ^--
+ | +++
error: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-twice.rs:70:9
@@ -119,6 +129,11 @@ LL | let a @ &mut ref mut b = &mut U;
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `&mut U` which does not implement the `Copy` trait
+ |
+help: borrow this binding in the pattern to avoid moving the value
+ |
+LL | let ref a @ &mut ref mut b = &mut U;
+ | +++
error: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-twice.rs:72:9
@@ -130,6 +145,11 @@ LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `&mut (U, U)` which does not implement the `Copy` trait
+ |
+help: borrow this binding in the pattern to avoid moving the value
+ |
+LL | let ref a @ &mut (ref mut b, ref mut c) = &mut (U, U);
+ | +++
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:76:9