2020-02-02 14:17:49 -06:00
|
|
|
error[E0382]: borrow of moved value: `tup0`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:31:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut tup0 = (S, S);
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `tup0` has type `(S, S)`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
LL | // Tuples...
|
|
|
|
LL | let (ref mut borrow, mov) = tup0;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup0);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup1`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:32:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut tup1 = (S, S, S);
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `tup1` has type `(S, S, S)`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | let (mov, _, ref mut borrow) = tup1;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup1);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup2`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:33:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup2 = (S, S);
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup2` has type `(S, S)`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | let (ref borrow, mov) = tup2;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup2);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup3`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:34:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup3 = (S, S, S);
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup3` has type `(S, S, S)`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | let (mov, _, ref borrow) = tup3;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup3);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup4`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:39:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup4 = (S, S);
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup4` has type `(S, S)`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | let (ref borrow, mov) = tup4;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup4.0);
|
|
|
|
| ^^^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr0`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:41:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut arr0 = [S, S, S];
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `arr0` has type `[S; 3]`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | let [mov @ .., ref borrow] = arr0;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&arr0);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr1`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:42:36
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut arr1 = [S, S, S, S, S];
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `arr1` has type `[S; 5]`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | let [_, ref mut borrow @ .., _, mov] = arr1;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | let [_, mov1, mov2, mov3, _] = &arr1;
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr2`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:43:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let arr2 = [S, S, S];
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `arr2` has type `[S; 3]`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | let [mov @ .., ref borrow] = arr2;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&arr2);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr3`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:44:36
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let arr3 = [S, S, S, S, S];
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `arr3` has type `[S; 5]`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | let [_, ref borrow @ .., _, mov] = arr3;
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | let [_, mov1, mov2, mov3, _] = &arr3;
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup0`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:75:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut tup0: Option<(S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `tup0` has type `Option<(S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
LL | m!((ref mut borrow, mov) = tup0);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup0);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup1`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:76:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut tup1: Option<(S, S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `tup1` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
LL | m!((ref mut borrow, mov) = tup0);
|
|
|
|
LL | m!((mov, _, ref mut borrow) = tup1);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup1);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup2`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:77:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup2: Option<(S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup2` has type `Option<(S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!((ref borrow, mov) = tup2);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup2);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup3`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:78:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup3: Option<(S, S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup3` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!((mov, _, ref borrow) = tup3);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup3);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup4`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:79:21
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup4: Option<(S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup4` has type `Option<(S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!((ref borrow, mov) = tup4);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | m!((ref x, _) = &tup4);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr0`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:80:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut arr0: Option<[S; 3]> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `arr0` has type `Option<[S; 3]>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!([mov @ .., ref borrow] = arr0);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&arr0);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr1`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:81:35
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut arr1: Option<[S; 5]> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `arr1` has type `Option<[S; 5]>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!([_, ref mut borrow @ .., _, mov] = arr1);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | m!([_, mov1, mov2, mov3, _] = &arr1);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr2`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:82:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let arr2: Option<[S; 3]> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `arr2` has type `Option<[S; 3]>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
LL | let arr3: Option<[S; 5]> = None;
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!([mov @ .., ref borrow] = arr2);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&arr2);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr3`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:83:35
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let arr3: Option<[S; 5]> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `arr3` has type `Option<[S; 5]>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!([_, ref borrow @ .., _, mov] = arr3);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | m!([_, mov1, mov2, mov3, _] = &arr3);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup0`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:111:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut tup0: Option<(S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `tup0` has type `Option<(S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
LL | m!((ref mut borrow, mov) = tup0);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup0);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup1`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:112:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut tup1: Option<(S, S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `tup1` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
LL | m!((ref mut borrow, mov) = tup0);
|
|
|
|
LL | m!((mov, _, ref mut borrow) = tup1);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup1);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup2`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:113:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup2: Option<(S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup2` has type `Option<(S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!((ref borrow, mov) = tup2);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup2);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup3`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:114:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup3: Option<(S, S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup3` has type `Option<(S, S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!((mov, _, ref borrow) = tup3);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&tup3);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `tup4`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:115:21
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let tup4: Option<(S, S)> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `tup4` has type `Option<(S, S)>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!((ref borrow, mov) = tup4);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | m!((ref x, _) = &tup4);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr0`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:116:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut arr0: Option<[S; 3]> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `arr0` has type `Option<[S; 3]>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!([mov @ .., ref borrow] = arr0);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&arr0);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr1`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:117:35
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let mut arr1: Option<[S; 5]> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| -------- move occurs because `arr1` has type `Option<[S; 5]>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
...
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!([_, ref mut borrow @ .., _, mov] = arr1);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | m!([_, mov1, mov2, mov3, _] = &arr1);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr2`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:118:10
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let arr2: Option<[S; 3]> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `arr2` has type `Option<[S; 3]>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
LL | let arr3: Option<[S; 5]> = None;
|
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!([mov @ .., ref borrow] = arr2);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | drop(&arr2);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value: `arr3`
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/move-ref-patterns-closure-captures-inside.rs:119:35
|
2020-02-02 14:17:49 -06:00
|
|
|
|
|
|
|
|
LL | let arr3: Option<[S; 5]> = None;
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---- move occurs because `arr3` has type `Option<[S; 5]>`, which does not implement the `Copy` trait
|
2020-02-02 14:17:49 -06:00
|
|
|
LL | let mut closure = || {
|
|
|
|
| -- value moved into closure here
|
|
|
|
...
|
|
|
|
LL | m!([_, ref borrow @ .., _, mov] = arr3);
|
|
|
|
| ---- variable moved due to use in closure
|
|
|
|
...
|
|
|
|
LL | m!([_, mov1, mov2, mov3, _] = &arr3);
|
|
|
|
| ^^^^^ value borrowed here after move
|
|
|
|
|
|
|
|
error: aborting due to 27 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|