about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-22 18:43:04 +0530
committerGitHub <noreply@github.com>2020-02-22 18:43:04 +0530
commit8ab4060057a7c70376dedf075fcb98a07868fc03 (patch)
treed06241f78682d1396c6752296e4c58b7cc6a6355 /src/test
parent1cb9fb5e166bc02cf57fcb7228bc87c34cf04562 (diff)
parent38a22b8130f6466352bca53d5020c44cd648326a (diff)
downloadrust-8ab4060057a7c70376dedf075fcb98a07868fc03.tar.gz
rust-8ab4060057a7c70376dedf075fcb98a07868fc03.zip
Rollup merge of #69348 - LeSeulArtichaut:patch-1, r=Centril
Wrong error message for move_ref_pattern

The current error message states that move occurs *because of `Copy`*:
```Rust
"move occurs because `{}` has type `{}` which does implement the `Copy` trait."
```
I found this randomly when surfing through the sources. This means, I don't have any context and might be completely wrong.

r? @Centril
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr4
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr2
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr50
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr8
-rw-r--r--src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr2
5 files changed, 33 insertions, 33 deletions
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
index 026747c212a..f2186b9298e 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
+++ b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
@@ -15,7 +15,7 @@ LL |         Some(_z @ ref _y) => {}
    |              |    |
    |              |    value borrowed here after move
    |              value moved into `_z` here
-   |              move occurs because `_z` has type `X` which does implement the `Copy` trait
+   |              move occurs because `_z` has type `X` which does not implement the `Copy` trait
 
 error: cannot move out of value because it is borrowed
   --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:29:14
@@ -34,7 +34,7 @@ LL |         Some(_z @ ref mut _y) => {}
    |              |    |
    |              |    value borrowed here after move
    |              value moved into `_z` here
-   |              move occurs because `_z` has type `X` which does implement the `Copy` trait
+   |              move occurs because `_z` has type `X` which does not implement the `Copy` trait
 
 error[E0382]: borrow of moved value
   --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:21:19
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
index 91fdfd4f2ab..54900e958c2 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
@@ -6,7 +6,7 @@ LL |     let a @ ref b = U;
    |         |   |
    |         |   value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `main::U` which does implement the `Copy` trait
+   |         move occurs because `a` has type `main::U` which does not implement the `Copy` trait
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
index ec86692dc69..f819e671436 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
@@ -6,7 +6,7 @@ LL |     let a @ ref b = U;
    |         |   |
    |         |   value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `main::U` which does implement the `Copy` trait
+   |         move occurs because `a` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:9
@@ -17,7 +17,7 @@ LL |     let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
    |         |            |              value borrowed here after move
    |         |            value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `(main::U, main::U)` which does implement the `Copy` trait
+   |         move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:14
@@ -27,7 +27,7 @@ LL |     let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
    |              |       |
    |              |       value borrowed here after move
    |              value moved into `b` here
-   |              move occurs because `b` has type `main::U` which does implement the `Copy` trait
+   |              move occurs because `b` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:33
@@ -37,7 +37,7 @@ LL |     let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
    |                                 |   |
    |                                 |   value borrowed here after move
    |                                 value moved into `d` here
-   |                                 move occurs because `d` has type `main::U` which does implement the `Copy` trait
+   |                                 move occurs because `d` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:38:9
@@ -48,7 +48,7 @@ LL |     let a @ [ref mut b, ref c] = [U, U];
    |         |    |          value borrowed here after move
    |         |    value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `[main::U; 2]` which does implement the `Copy` trait
+   |         move occurs because `a` has type `[main::U; 2]` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:41:9
@@ -58,7 +58,7 @@ LL |     let a @ ref b = u();
    |         |   |
    |         |   value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `main::U` which does implement the `Copy` trait
+   |         move occurs because `a` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:44:9
@@ -69,7 +69,7 @@ LL |     let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
    |         |            |              value borrowed here after move
    |         |            value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `(main::U, main::U)` which does implement the `Copy` trait
+   |         move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:44:14
@@ -79,7 +79,7 @@ LL |     let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
    |              |       |
    |              |       value borrowed here after move
    |              value moved into `b` here
-   |              move occurs because `b` has type `main::U` which does implement the `Copy` trait
+   |              move occurs because `b` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:44:33
@@ -89,7 +89,7 @@ LL |     let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
    |                                 |   |
    |                                 |   value borrowed here after move
    |                                 value moved into `d` here
-   |                                 move occurs because `d` has type `main::U` which does implement the `Copy` trait
+   |                                 move occurs because `d` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:51:9
@@ -100,7 +100,7 @@ LL |     let a @ [ref mut b, ref c] = [u(), u()];
    |         |    |          value borrowed here after move
    |         |    value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `[main::U; 2]` which does implement the `Copy` trait
+   |         move occurs because `a` has type `[main::U; 2]` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:56:9
@@ -110,7 +110,7 @@ LL |         a @ Some(ref b) => {}
    |         |        |
    |         |        value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `std::option::Option<main::U>` which does implement the `Copy` trait
+   |         move occurs because `a` has type `std::option::Option<main::U>` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:9
@@ -121,7 +121,7 @@ LL |         a @ Some((mut b @ ref mut c, d @ ref e)) => {}
    |         |                 |              value borrowed here after move
    |         |                 value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `std::option::Option<(main::U, main::U)>` which does implement the `Copy` trait
+   |         move occurs because `a` has type `std::option::Option<(main::U, main::U)>` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:19
@@ -131,7 +131,7 @@ LL |         a @ Some((mut b @ ref mut c, d @ ref e)) => {}
    |                   |       |
    |                   |       value borrowed here after move
    |                   value moved into `b` here
-   |                   move occurs because `b` has type `main::U` which does implement the `Copy` trait
+   |                   move occurs because `b` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:38
@@ -141,7 +141,7 @@ LL |         a @ Some((mut b @ ref mut c, d @ ref e)) => {}
    |                                      |   |
    |                                      |   value borrowed here after move
    |                                      value moved into `d` here
-   |                                      move occurs because `d` has type `main::U` which does implement the `Copy` trait
+   |                                      move occurs because `d` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:71:9
@@ -152,7 +152,7 @@ LL |         mut a @ Some([ref b, ref mut c]) => {}
    |         |             |      value borrowed here after move
    |         |             value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `std::option::Option<[main::U; 2]>` which does implement the `Copy` trait
+   |         move occurs because `a` has type `std::option::Option<[main::U; 2]>` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:77:9
@@ -162,7 +162,7 @@ LL |         a @ Some(ref b) => {}
    |         |        |
    |         |        value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `std::option::Option<main::U>` which does implement the `Copy` trait
+   |         move occurs because `a` has type `std::option::Option<main::U>` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:83:9
@@ -173,7 +173,7 @@ LL |         a @ Some((mut b @ ref mut c, d @ ref e)) => {}
    |         |                 |              value borrowed here after move
    |         |                 value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `std::option::Option<(main::U, main::U)>` which does implement the `Copy` trait
+   |         move occurs because `a` has type `std::option::Option<(main::U, main::U)>` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:83:19
@@ -183,7 +183,7 @@ LL |         a @ Some((mut b @ ref mut c, d @ ref e)) => {}
    |                   |       |
    |                   |       value borrowed here after move
    |                   value moved into `b` here
-   |                   move occurs because `b` has type `main::U` which does implement the `Copy` trait
+   |                   move occurs because `b` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:83:38
@@ -193,7 +193,7 @@ LL |         a @ Some((mut b @ ref mut c, d @ ref e)) => {}
    |                                      |   |
    |                                      |   value borrowed here after move
    |                                      value moved into `d` here
-   |                                      move occurs because `d` has type `main::U` which does implement the `Copy` trait
+   |                                      move occurs because `d` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:93:9
@@ -204,7 +204,7 @@ LL |         mut a @ Some([ref b, ref mut c]) => {}
    |         |             |      value borrowed here after move
    |         |             value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `std::option::Option<[main::U; 2]>` which does implement the `Copy` trait
+   |         move occurs because `a` has type `std::option::Option<[main::U; 2]>` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:11
@@ -214,7 +214,7 @@ LL |     fn f1(a @ ref b: U) {}
    |           |   |
    |           |   value borrowed here after move
    |           value moved into `a` here
-   |           move occurs because `a` has type `main::U` which does implement the `Copy` trait
+   |           move occurs because `a` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:11
@@ -225,7 +225,7 @@ LL |     fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
    |           |            |              value borrowed here after move
    |           |            value borrowed here after move
    |           value moved into `a` here
-   |           move occurs because `a` has type `(main::U, main::U)` which does implement the `Copy` trait
+   |           move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:20
@@ -235,7 +235,7 @@ LL |     fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
    |                    |   |
    |                    |   value borrowed here after move
    |                    value moved into `b` here
-   |                    move occurs because `b` has type `main::U` which does implement the `Copy` trait
+   |                    move occurs because `b` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:18:31
@@ -245,7 +245,7 @@ LL |     fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
    |                               |       |
    |                               |       value borrowed here after move
    |                               value moved into `d` here
-   |                               move occurs because `d` has type `main::U` which does implement the `Copy` trait
+   |                               move occurs because `d` has type `main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:25:11
@@ -256,7 +256,7 @@ LL |     fn f3(a @ [ref mut b, ref c]: [U; 2]) {}
    |           |    |          value borrowed here after move
    |           |    value borrowed here after move
    |           value moved into `a` here
-   |           move occurs because `a` has type `[main::U; 2]` which does implement the `Copy` trait
+   |           move occurs because `a` has type `[main::U; 2]` which does not implement the `Copy` trait
 
 error[E0382]: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:22
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
index 4e96c6e1669..e74f227b5e4 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
@@ -96,7 +96,7 @@ LL |     let a @ (ref mut b, ref mut c) = (U, U);
    |         |    |          value borrowed here after move
    |         |    value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `(main::U, main::U)` which does implement the `Copy` trait
+   |         move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-ref-mut-twice.rs:70:9
@@ -108,7 +108,7 @@ LL |     let a @ (b, [c, d]) = &mut val; // Same as ^--
    |         |    |   value borrowed here after move
    |         |    value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `&mut (main::U, [main::U; 2])` which does implement the `Copy` trait
+   |         move occurs because `a` has type `&mut (main::U, [main::U; 2])` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-ref-mut-twice.rs:74:9
@@ -118,7 +118,7 @@ LL |     let a @ &mut ref mut b = &mut U;
    |         |        |
    |         |        value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `&mut main::U` which does implement the `Copy` trait
+   |         move occurs because `a` has type `&mut main::U` which does not implement the `Copy` trait
 
 error: borrow of moved value
   --> $DIR/borrowck-pat-ref-mut-twice.rs:77:9
@@ -129,7 +129,7 @@ LL |     let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
    |         |         |          value borrowed here after move
    |         |         value borrowed here after move
    |         value moved into `a` here
-   |         move occurs because `a` has type `&mut (main::U, main::U)` which does implement the `Copy` trait
+   |         move occurs because `a` has type `&mut (main::U, main::U)` which does not implement the `Copy` trait
 
 error: cannot borrow value as mutable more than once at a time
   --> $DIR/borrowck-pat-ref-mut-twice.rs:82:9
diff --git a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
index 697a8b96e63..19e815a1ae8 100644
--- a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
+++ b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
@@ -33,7 +33,7 @@ LL |         Ok(ref a @ b) | Err(b @ ref a) => {
    |                             |   |
    |                             |   value borrowed here after move
    |                             value moved into `b` here
-   |                             move occurs because `b` has type `main::NotCopy` which does implement the `Copy` trait
+   |                             move occurs because `b` has type `main::NotCopy` which does not implement the `Copy` trait
 
 error: cannot move out of value because it is borrowed
   --> $DIR/default-binding-modes-both-sides-independent.rs:44:9