]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr
Update tests for changes to cannot move errors
[rust.git] / src / test / ui / suggestions / dont-suggest-ref / move-into-closure.stderr
index 74f3a63be57de2886d2c28b829c06b56532d185c..c50cbcde85553f43743b419998318f1a51588ced 100644 (file)
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:28:21
    |
 LL |     let x = X(Y);
    |         - captured outer variable
 ...
 LL |         let X(_t) = x;
-   |               --    ^
-   |               |     |
-   |               |     cannot move out of captured variable in an `Fn` closure
-   |               |     help: consider borrowing here: `&x`
+   |               --    ^ help: consider borrowing here: `&x`
+   |               |
    |               data moved here
-   |
-note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:28:15
-   |
-LL |         let X(_t) = x;
-   |               ^^
+   |               move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:32:34
    |
 LL |     let e = Either::One(X(Y));
    |         - captured outer variable
 ...
 LL |         if let Either::One(_t) = e { }
-   |                            --    ^
-   |                            |     |
-   |                            |     cannot move out of captured variable in an `Fn` closure
-   |                            |     help: consider borrowing here: `&e`
+   |                            --    ^ help: consider borrowing here: `&e`
+   |                            |
    |                            data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:32:28
-   |
-LL |         if let Either::One(_t) = e { }
-   |                            ^^
+   |                            move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:36:37
    |
 LL |     let e = Either::One(X(Y));
    |         - captured outer variable
 ...
 LL |         while let Either::One(_t) = e { }
-   |                               --    ^
-   |                               |     |
-   |                               |     cannot move out of captured variable in an `Fn` closure
-   |                               |     help: consider borrowing here: `&e`
+   |                               --    ^ help: consider borrowing here: `&e`
+   |                               |
    |                               data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:36:31
-   |
-LL |         while let Either::One(_t) = e { }
-   |                               ^^
+   |                               move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:40:15
    |
 LL |     let e = Either::One(X(Y));
    |         - captured outer variable
 ...
 LL |         match e {
-   |               ^
-   |               |
-   |               cannot move out of captured variable in an `Fn` closure
-   |               help: consider borrowing here: `&e`
+   |               ^ help: consider borrowing here: `&e`
 ...
 LL |             Either::One(_t)
-   |                         -- data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:44:25
-   |
-LL |             Either::One(_t)
-   |                         ^^
+   |                         --
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:47:15
    |
 LL |     let e = Either::One(X(Y));
    |         - captured outer variable
 ...
 LL |         match e {
-   |               ^
-   |               |
-   |               cannot move out of captured variable in an `Fn` closure
-   |               help: consider borrowing here: `&e`
+   |               ^ help: consider borrowing here: `&e`
 ...
 LL |             Either::One(_t) => (),
-   |                         -- data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:51:25
-   |
-LL |             Either::One(_t) => (),
-   |                         ^^
+   |                         --
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:56:25
    |
 LL |     let x = X(Y);
    |         - captured outer variable
 ...
 LL |         let X(mut _t) = x;
-   |               ------    ^
-   |               |         |
-   |               |         cannot move out of captured variable in an `Fn` closure
-   |               |         help: consider borrowing here: `&x`
+   |               ------    ^ help: consider borrowing here: `&x`
+   |               |
    |               data moved here
-   |
-note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:56:15
-   |
-LL |         let X(mut _t) = x;
-   |               ^^^^^^
+   |               move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:60:38
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         if let Either::One(mut _t) = em { }
-   |                            ------    ^^
-   |                            |         |
-   |                            |         cannot move out of captured variable in an `Fn` closure
-   |                            |         help: consider borrowing here: `&em`
+   |                            ------    ^^ help: consider borrowing here: `&em`
+   |                            |
    |                            data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:60:28
-   |
-LL |         if let Either::One(mut _t) = em { }
-   |                            ^^^^^^
+   |                            move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:64:41
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         while let Either::One(mut _t) = em { }
-   |                               ------    ^^
-   |                               |         |
-   |                               |         cannot move out of captured variable in an `Fn` closure
-   |                               |         help: consider borrowing here: `&em`
+   |                               ------    ^^ help: consider borrowing here: `&em`
+   |                               |
    |                               data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:64:31
-   |
-LL |         while let Either::One(mut _t) = em { }
-   |                               ^^^^^^
+   |                               move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:68:15
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         match em {
-   |               ^^
-   |               |
-   |               cannot move out of captured variable in an `Fn` closure
-   |               help: consider borrowing here: `&em`
+   |               ^^ help: consider borrowing here: `&em`
 ...
 LL |             Either::One(mut _t)
-   |                         ------ data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:72:25
-   |
-LL |             Either::One(mut _t)
-   |                         ^^^^^^
+   |                         ------
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `Fn` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `Fn` closure
   --> $DIR/move-into-closure.rs:75:15
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         match em {
-   |               ^^
-   |               |
-   |               cannot move out of captured variable in an `Fn` closure
-   |               help: consider borrowing here: `&em`
+   |               ^^ help: consider borrowing here: `&em`
 ...
 LL |             Either::One(mut _t) => (),
-   |                         ------ data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:79:25
-   |
-LL |             Either::One(mut _t) => (),
-   |                         ^^^^^^
+   |                         ------
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:95:21
    |
 LL |     let x = X(Y);
    |         - captured outer variable
 ...
 LL |         let X(_t) = x;
-   |               --    ^
-   |               |     |
-   |               |     cannot move out of captured variable in an `FnMut` closure
-   |               |     help: consider borrowing here: `&x`
+   |               --    ^ help: consider borrowing here: `&x`
+   |               |
    |               data moved here
-   |
-note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:95:15
-   |
-LL |         let X(_t) = x;
-   |               ^^
+   |               move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:99:34
    |
 LL |     let e = Either::One(X(Y));
    |         - captured outer variable
 ...
 LL |         if let Either::One(_t) = e { }
-   |                            --    ^
-   |                            |     |
-   |                            |     cannot move out of captured variable in an `FnMut` closure
-   |                            |     help: consider borrowing here: `&e`
+   |                            --    ^ help: consider borrowing here: `&e`
+   |                            |
    |                            data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:99:28
-   |
-LL |         if let Either::One(_t) = e { }
-   |                            ^^
+   |                            move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:103:37
    |
 LL |     let e = Either::One(X(Y));
    |         - captured outer variable
 ...
 LL |         while let Either::One(_t) = e { }
-   |                               --    ^
-   |                               |     |
-   |                               |     cannot move out of captured variable in an `FnMut` closure
-   |                               |     help: consider borrowing here: `&e`
+   |                               --    ^ help: consider borrowing here: `&e`
+   |                               |
    |                               data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:103:31
-   |
-LL |         while let Either::One(_t) = e { }
-   |                               ^^
+   |                               move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:107:15
    |
 LL |     let e = Either::One(X(Y));
    |         - captured outer variable
 ...
 LL |         match e {
-   |               ^
-   |               |
-   |               cannot move out of captured variable in an `FnMut` closure
-   |               help: consider borrowing here: `&e`
+   |               ^ help: consider borrowing here: `&e`
 ...
 LL |             Either::One(_t)
-   |                         -- data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:111:25
-   |
-LL |             Either::One(_t)
-   |                         ^^
+   |                         --
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `e.0`, as `e` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:114:15
    |
 LL |     let e = Either::One(X(Y));
    |         - captured outer variable
 ...
 LL |         match e {
-   |               ^
-   |               |
-   |               cannot move out of captured variable in an `FnMut` closure
-   |               help: consider borrowing here: `&e`
+   |               ^ help: consider borrowing here: `&e`
 ...
 LL |             Either::One(_t) => (),
-   |                         -- data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:118:25
-   |
-LL |             Either::One(_t) => (),
-   |                         ^^
+   |                         --
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `x.0`, as `x` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:123:25
    |
 LL |     let x = X(Y);
    |         - captured outer variable
 ...
 LL |         let X(mut _t) = x;
-   |               ------    ^
-   |               |         |
-   |               |         cannot move out of captured variable in an `FnMut` closure
-   |               |         help: consider borrowing here: `&x`
+   |               ------    ^ help: consider borrowing here: `&x`
+   |               |
    |               data moved here
-   |
-note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:123:15
-   |
-LL |         let X(mut _t) = x;
-   |               ^^^^^^
+   |               move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:127:38
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         if let Either::One(mut _t) = em { }
-   |                            ------    ^^
-   |                            |         |
-   |                            |         cannot move out of captured variable in an `FnMut` closure
-   |                            |         help: consider borrowing here: `&em`
+   |                            ------    ^^ help: consider borrowing here: `&em`
+   |                            |
    |                            data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:127:28
-   |
-LL |         if let Either::One(mut _t) = em { }
-   |                            ^^^^^^
+   |                            move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:131:41
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         while let Either::One(mut _t) = em { }
-   |                               ------    ^^
-   |                               |         |
-   |                               |         cannot move out of captured variable in an `FnMut` closure
-   |                               |         help: consider borrowing here: `&em`
+   |                               ------    ^^ help: consider borrowing here: `&em`
+   |                               |
    |                               data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:131:31
-   |
-LL |         while let Either::One(mut _t) = em { }
-   |                               ^^^^^^
+   |                               move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:135:15
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         match em {
-   |               ^^
-   |               |
-   |               cannot move out of captured variable in an `FnMut` closure
-   |               help: consider borrowing here: `&em`
+   |               ^^ help: consider borrowing here: `&em`
 ...
 LL |             Either::One(mut _t)
-   |                         ------ data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:139:25
-   |
-LL |             Either::One(mut _t)
-   |                         ^^^^^^
+   |                         ------
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:142:15
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         match em {
-   |               ^^
-   |               |
-   |               cannot move out of captured variable in an `FnMut` closure
-   |               help: consider borrowing here: `&em`
+   |               ^^ help: consider borrowing here: `&em`
 ...
 LL |             Either::One(mut _t) => (),
-   |                         ------ data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:146:25
-   |
-LL |             Either::One(mut _t) => (),
-   |                         ^^^^^^
+   |                         ------
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of captured variable in an `FnMut` closure
+error[E0507]: cannot move out of `em.0`, as `em` is a captured variable in an `FnMut` closure
   --> $DIR/move-into-closure.rs:150:15
    |
 LL |     let mut em = Either::One(X(Y));
    |         ------ captured outer variable
 ...
 LL |         match em {
-   |               ^^
-   |               |
-   |               cannot move out of captured variable in an `FnMut` closure
-   |               help: consider borrowing here: `&em`
+   |               ^^ help: consider borrowing here: `&em`
 ...
 LL |             Either::One(mut _t) => (),
-   |                         ------ data moved here
-   |
-note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait
-  --> $DIR/move-into-closure.rs:154:25
-   |
-LL |             Either::One(mut _t) => (),
-   |                         ^^^^^^
+   |                         ------
+   |                         |
+   |                         data moved here
+   |                         move occurs because `_t` has type `X`, which does not implement the `Copy` trait
 
 error: aborting due to 21 previous errors