2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure
|
2019-04-07 10:07:36 -05:00
|
|
|
--> $DIR/move-into-closure.rs:28:21
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let x = X(Y);
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
LL | let X(_t) = x;
|
2022-12-08 11:02:54 -06:00
|
|
|
| -- ^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | let X(_t) = &x;
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:31:34
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let e = Either::One(X(Y));
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | if let Either::One(_t) = e { }
|
2022-12-08 11:02:54 -06:00
|
|
|
| -- ^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | if let Either::One(_t) = &e { }
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:34:37
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let e = Either::One(X(Y));
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | while let Either::One(_t) = e { }
|
2022-12-08 11:02:54 -06:00
|
|
|
| -- ^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | while let Either::One(_t) = &e { }
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:37:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let e = Either::One(X(Y));
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | match e {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(_t)
|
|
|
|
| --
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &e {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:43:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let e = Either::One(X(Y));
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | match e {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(_t) => (),
|
|
|
|
| --
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &e {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:51:25
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let x = X(Y);
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | let X(mut _t) = x;
|
2022-12-08 11:02:54 -06:00
|
|
|
| ------ ^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | let X(mut _t) = &x;
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:54:38
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | if let Either::One(mut _t) = em { }
|
2022-12-08 11:02:54 -06:00
|
|
|
| ------ ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | if let Either::One(mut _t) = &em { }
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:57:41
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | while let Either::One(mut _t) = em { }
|
2022-12-08 11:02:54 -06:00
|
|
|
| ------ ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | while let Either::One(mut _t) = &em { }
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:60:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | match em {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(mut _t)
|
|
|
|
| ------
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &em {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:66:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fn(|| {
|
|
|
|
| -- captured by this `Fn` closure
|
|
|
|
...
|
|
|
|
LL | match em {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(mut _t) => (),
|
|
|
|
| ------
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &em {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:85:21
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let x = X(Y);
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
LL | let X(_t) = x;
|
2022-12-08 11:02:54 -06:00
|
|
|
| -- ^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | let X(_t) = &x;
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:88:34
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let e = Either::One(X(Y));
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | if let Either::One(_t) = e { }
|
2022-12-08 11:02:54 -06:00
|
|
|
| -- ^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | if let Either::One(_t) = &e { }
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:91:37
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let e = Either::One(X(Y));
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | while let Either::One(_t) = e { }
|
2022-12-08 11:02:54 -06:00
|
|
|
| -- ^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | while let Either::One(_t) = &e { }
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:94:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let e = Either::One(X(Y));
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | match e {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(_t)
|
|
|
|
| --
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &e {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:100:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let e = Either::One(X(Y));
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | match e {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(_t) => (),
|
|
|
|
| --
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &e {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:108:25
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let x = X(Y);
|
|
|
|
| - captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | let X(mut _t) = x;
|
2022-12-08 11:02:54 -06:00
|
|
|
| ------ ^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | let X(mut _t) = &x;
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:111:38
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | if let Either::One(mut _t) = em { }
|
2022-12-08 11:02:54 -06:00
|
|
|
| ------ ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | if let Either::One(mut _t) = &em { }
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:114:41
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | while let Either::One(mut _t) = em { }
|
2022-12-08 11:02:54 -06:00
|
|
|
| ------ ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | while let Either::One(mut _t) = &em { }
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:117:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | match em {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(mut _t)
|
|
|
|
| ------
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &em {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:123:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | match em {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(mut _t) => (),
|
|
|
|
| ------
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &em {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
|
2022-12-08 11:02:54 -06:00
|
|
|
--> $DIR/move-into-closure.rs:130:15
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | let mut em = Either::One(X(Y));
|
|
|
|
| ------ captured outer variable
|
|
|
|
...
|
|
|
|
LL | consume_fnmut(|| {
|
|
|
|
| -- captured by this `FnMut` closure
|
|
|
|
...
|
|
|
|
LL | match em {
|
2022-12-08 11:02:54 -06:00
|
|
|
| ^^
|
2022-06-27 00:45:35 -05:00
|
|
|
...
|
|
|
|
LL | Either::One(mut _t) => (),
|
|
|
|
| ------
|
|
|
|
| |
|
|
|
|
| data moved here
|
|
|
|
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
2022-12-08 11:02:54 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
|
|
|
|
LL | match &em {
|
|
|
|
| +
|
2018-08-14 13:56:20 -05:00
|
|
|
|
|
|
|
error: aborting due to 21 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0507`.
|