summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr (renamed from src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr)187
1 files changed, 146 insertions, 41 deletions
diff --git a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr
index e06ee4290..edda2cbc7 100644
--- a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr
+++ b/tests/ui/suggestions/dont-suggest-ref/move-into-closure.stderr
@@ -7,13 +7,18 @@ LL | let x = X(Y);
LL | consume_fn(|| {
| -- captured by this `Fn` closure
LL | let X(_t) = x;
- | -- ^ help: consider borrowing here: `&x`
+ | -- ^
| |
| data moved here
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | let X(_t) = &x;
+ | +
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
+ --> $DIR/move-into-closure.rs:31:34
|
LL | let e = Either::One(X(Y));
| - captured outer variable
@@ -22,13 +27,18 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | if let Either::One(_t) = e { }
- | -- ^ help: consider borrowing here: `&e`
+ | -- ^
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | if let Either::One(_t) = &e { }
+ | +
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
+ --> $DIR/move-into-closure.rs:34:37
|
LL | let e = Either::One(X(Y));
| - captured outer variable
@@ -37,13 +47,18 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | while let Either::One(_t) = e { }
- | -- ^ help: consider borrowing here: `&e`
+ | -- ^
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | while let Either::One(_t) = &e { }
+ | +
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
+ --> $DIR/move-into-closure.rs:37:15
|
LL | let e = Either::One(X(Y));
| - captured outer variable
@@ -52,16 +67,21 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | match e {
- | ^ help: consider borrowing here: `&e`
+ | ^
...
LL | Either::One(_t)
| --
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &e {
+ | +
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
+ --> $DIR/move-into-closure.rs:43:15
|
LL | let e = Either::One(X(Y));
| - captured outer variable
@@ -70,16 +90,21 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | match e {
- | ^ help: consider borrowing here: `&e`
+ | ^
...
LL | Either::One(_t) => (),
| --
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &e {
+ | +
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
+ --> $DIR/move-into-closure.rs:51:25
|
LL | let x = X(Y);
| - captured outer variable
@@ -88,13 +113,18 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | let X(mut _t) = x;
- | ------ ^ help: consider borrowing here: `&x`
+ | ------ ^
| |
| data moved here
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | let X(mut _t) = &x;
+ | +
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
+ --> $DIR/move-into-closure.rs:54:38
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -103,13 +133,18 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | if let Either::One(mut _t) = em { }
- | ------ ^^ help: consider borrowing here: `&em`
+ | ------ ^^
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | if let Either::One(mut _t) = &em { }
+ | +
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
+ --> $DIR/move-into-closure.rs:57:41
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -118,13 +153,18 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | while let Either::One(mut _t) = em { }
- | ------ ^^ help: consider borrowing here: `&em`
+ | ------ ^^
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | while let Either::One(mut _t) = &em { }
+ | +
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
+ --> $DIR/move-into-closure.rs:60:15
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -133,16 +173,21 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | match em {
- | ^^ help: consider borrowing here: `&em`
+ | ^^
...
LL | Either::One(mut _t)
| ------
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &em {
+ | +
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
+ --> $DIR/move-into-closure.rs:66:15
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -151,16 +196,21 @@ LL | consume_fn(|| {
| -- captured by this `Fn` closure
...
LL | match em {
- | ^^ help: consider borrowing here: `&em`
+ | ^^
...
LL | Either::One(mut _t) => (),
| ------
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &em {
+ | +
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
+ --> $DIR/move-into-closure.rs:85:21
|
LL | let x = X(Y);
| - captured outer variable
@@ -168,13 +218,18 @@ LL | let x = X(Y);
LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
LL | let X(_t) = x;
- | -- ^ help: consider borrowing here: `&x`
+ | -- ^
| |
| data moved here
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | let X(_t) = &x;
+ | +
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
+ --> $DIR/move-into-closure.rs:88:34
|
LL | let e = Either::One(X(Y));
| - captured outer variable
@@ -183,13 +238,18 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | if let Either::One(_t) = e { }
- | -- ^ help: consider borrowing here: `&e`
+ | -- ^
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | if let Either::One(_t) = &e { }
+ | +
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
+ --> $DIR/move-into-closure.rs:91:37
|
LL | let e = Either::One(X(Y));
| - captured outer variable
@@ -198,13 +258,18 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | while let Either::One(_t) = e { }
- | -- ^ help: consider borrowing here: `&e`
+ | -- ^
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | while let Either::One(_t) = &e { }
+ | +
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
+ --> $DIR/move-into-closure.rs:94:15
|
LL | let e = Either::One(X(Y));
| - captured outer variable
@@ -213,16 +278,21 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | match e {
- | ^ help: consider borrowing here: `&e`
+ | ^
...
LL | Either::One(_t)
| --
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &e {
+ | +
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
+ --> $DIR/move-into-closure.rs:100:15
|
LL | let e = Either::One(X(Y));
| - captured outer variable
@@ -231,16 +301,21 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | match e {
- | ^ help: consider borrowing here: `&e`
+ | ^
...
LL | Either::One(_t) => (),
| --
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &e {
+ | +
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
+ --> $DIR/move-into-closure.rs:108:25
|
LL | let x = X(Y);
| - captured outer variable
@@ -249,13 +324,18 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | let X(mut _t) = x;
- | ------ ^ help: consider borrowing here: `&x`
+ | ------ ^
| |
| data moved here
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | let X(mut _t) = &x;
+ | +
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
+ --> $DIR/move-into-closure.rs:111:38
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -264,13 +344,18 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | if let Either::One(mut _t) = em { }
- | ------ ^^ help: consider borrowing here: `&em`
+ | ------ ^^
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | if let Either::One(mut _t) = &em { }
+ | +
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
+ --> $DIR/move-into-closure.rs:114:41
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -279,13 +364,18 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | while let Either::One(mut _t) = em { }
- | ------ ^^ help: consider borrowing here: `&em`
+ | ------ ^^
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | while let Either::One(mut _t) = &em { }
+ | +
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
+ --> $DIR/move-into-closure.rs:117:15
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -294,16 +384,21 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | match em {
- | ^^ help: consider borrowing here: `&em`
+ | ^^
...
LL | Either::One(mut _t)
| ------
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &em {
+ | +
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
+ --> $DIR/move-into-closure.rs:123:15
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -312,16 +407,21 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | match em {
- | ^^ help: consider borrowing here: `&em`
+ | ^^
...
LL | Either::One(mut _t) => (),
| ------
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &em {
+ | +
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
+ --> $DIR/move-into-closure.rs:130:15
|
LL | let mut em = Either::One(X(Y));
| ------ captured outer variable
@@ -330,13 +430,18 @@ LL | consume_fnmut(|| {
| -- captured by this `FnMut` closure
...
LL | match em {
- | ^^ help: consider borrowing here: `&em`
+ | ^^
...
LL | Either::One(mut _t) => (),
| ------
| |
| data moved here
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
+ |
+help: consider borrowing here
+ |
+LL | match &em {
+ | +
error: aborting due to 21 previous errors