diff options
Diffstat (limited to 'src/test/ui/borrowck/or-patterns.stderr')
-rw-r--r-- | src/test/ui/borrowck/or-patterns.stderr | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/borrowck/or-patterns.stderr b/src/test/ui/borrowck/or-patterns.stderr index dd5797c3f..9501798bb 100644 --- a/src/test/ui/borrowck/or-patterns.stderr +++ b/src/test/ui/borrowck/or-patterns.stderr @@ -8,6 +8,10 @@ LL | &x.0 .0; | ^^^^^^^ value borrowed here after move | = note: move occurs because `x.0.0` has type `String`, which does not implement the `Copy` trait +help: borrow this binding in the pattern to avoid moving the value + | +LL | ((ref y, _) | (_, y),) => (), + | +++ error[E0382]: borrow of moved value: `x.0.1` --> $DIR/or-patterns.rs:10:5 @@ -19,6 +23,10 @@ LL | &x.0 .1; | ^^^^^^^ value borrowed here after move | = note: move occurs because `x.0.1` has type `String`, which does not implement the `Copy` trait +help: borrow this binding in the pattern to avoid moving the value + | +LL | ((y, _) | (_, ref y),) => (), + | +++ error[E0502]: cannot borrow `x.0.0` as mutable because it is also borrowed as immutable --> $DIR/or-patterns.rs:18:5 @@ -77,6 +85,10 @@ LL | &x.0 .0; | ^^^^^^^ value borrowed here after move | = note: move occurs because `x.0.0` has type `String`, which does not implement the `Copy` trait +help: borrow this binding in the pattern to avoid moving the value + | +LL | let ((ref y, _) | (_, y),) = x; + | +++ error[E0382]: borrow of moved value: `x.0.1` --> $DIR/or-patterns.rs:40:5 @@ -88,6 +100,10 @@ LL | &x.0 .1; | ^^^^^^^ value borrowed here after move | = note: move occurs because `x.0.1` has type `String`, which does not implement the `Copy` trait +help: borrow this binding in the pattern to avoid moving the value + | +LL | let ((y, _) | (_, ref y),) = x; + | +++ error[E0502]: cannot borrow `x.0.0` as mutable because it is also borrowed as immutable --> $DIR/or-patterns.rs:46:5 |