about summary refs log tree commit diff
path: root/src/test/ui/pattern
diff options
context:
space:
mode:
authorVishnunarayan K I <appukuttancr@gmail.com>2020-11-02 22:29:20 +0530
committerVishnunarayan K I <appukuttancr@gmail.com>2020-11-02 22:29:20 +0530
commit6bdce7bedd765438ce4f138cb0ce9335659e32d6 (patch)
treedd9bc7a6c6162b9f4398d2f1c8af2bdea71e86c5 /src/test/ui/pattern
parent9088807dd31f205b443fd2f6cef32f5ea295ecae (diff)
downloadrust-6bdce7bedd765438ce4f138cb0ce9335659e32d6.tar.gz
rust-6bdce7bedd765438ce4f138cb0ce9335659e32d6.zip
new fix method and update tests
Diffstat (limited to 'src/test/ui/pattern')
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr18
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr38
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr38
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr18
-rw-r--r--src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs2
5 files changed, 57 insertions, 57 deletions
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
index b9be8968823..482ebd9b423 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
@@ -11,9 +11,9 @@ error[E0382]: use of partially moved value
   --> $DIR/borrowck-move-and-move.rs:15:9
    |
 LL |     let a @ (b, c) = (U, U);
-   |         ^^^^^-^^^^
-   |         |    |
-   |         |    value partially moved here
+   |         ^^^^^^^^-^
+   |         |       |
+   |         |       value partially moved here
    |         value used here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -22,9 +22,9 @@ error[E0382]: use of partially moved value
   --> $DIR/borrowck-move-and-move.rs:17:9
    |
 LL |     let a @ (b, c) = (u(), u());
-   |         ^^^^^-^^^^
-   |         |    |
-   |         |    value partially moved here
+   |         ^^^^^^^^-^
+   |         |       |
+   |         |       value partially moved here
    |         value used here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -63,9 +63,9 @@ error[E0382]: use of partially moved value
   --> $DIR/borrowck-move-and-move.rs:27:9
    |
 LL |         xs @ [a, .., b] => {}
-   |         ^^^^^^-^^^^^^^^
-   |         |     |
-   |         |     value partially moved here
+   |         ^^^^^^^^^^^^^-^
+   |         |            |
+   |         |            value partially moved here
    |         value used here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
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 4a126a22192..c1ea5d8ec6d 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
@@ -262,9 +262,9 @@ error[E0382]: use of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:26:9
    |
 LL |     let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
-   |         ^^^^^-----------------^^^^^^^^^^^^
-   |         |    |
-   |         |    value partially moved here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^---------^
+   |         |                       |
+   |         |                       value partially moved here
    |         value used here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -273,9 +273,9 @@ error[E0382]: use of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:35:9
    |
 LL |     let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
-   |         ^^^^^-----------------^^^^^^^^^^^^
-   |         |    |
-   |         |    value partially moved here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^---------^
+   |         |                       |
+   |         |                       value partially moved here
    |         value used here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -284,39 +284,39 @@ error[E0382]: use of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:49:9
    |
 LL |         a @ Some((mut b @ ref mut c, d @ ref e)) => {}
-   |         ^^^^^^^^^^-----------------^^^^^^^^^^^^^
-   |         |         |
-   |         |         value partially moved here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^^
+   |         |                            |
+   |         |                            value partially moved here
    |         value used here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
 help: borrow this field in the pattern to avoid moving the value
    |
-LL |         a @ Some((ref mut b @ ref mut c, d @ ref e)) => {}
-   |                   ^^^
+LL |         a @ Some((mut b @ ref mut c, ref d @ ref e)) => {}
+   |                                      ^^^
 
 error[E0382]: use of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:9
    |
 LL |         a @ Some((mut b @ ref mut c, d @ ref e)) => {}
-   |         ^^^^^^^^^^-----------------^^^^^^^^^^^^^
-   |         |         |
-   |         |         value partially moved here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^^
+   |         |                            |
+   |         |                            value partially moved here
    |         value used here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
 help: borrow this field in the pattern to avoid moving the value
    |
-LL |         a @ Some((ref mut b @ ref mut c, d @ ref e)) => {}
-   |                   ^^^
+LL |         a @ Some((mut b @ ref mut c, ref d @ ref e)) => {}
+   |                                      ^^^
 
 error[E0382]: use of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:16:11
    |
 LL |     fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
-   |           ^^^^^^^^^---------^^^^^^^^^^^^^^^^
-   |           |        |
-   |           |        value partially moved here
+   |           ^^^^^^^^^^^^^^^^^^^^-------------^
+   |           |                   |
+   |           |                   value partially moved here
    |           value used here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
index 9113821d746..a39ff8774f7 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
@@ -237,9 +237,9 @@ error[E0382]: borrow of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref.rs:32:9
    |
 LL |     let ref mut a @ [b, mut c] = [U, U];
-   |         ^^^^^^^^^^^^^-^^^^^^^^
-   |         |            |
-   |         |            value partially moved here
+   |         ^^^^^^^^^^^^^^^^-----^
+   |         |               |
+   |         |               value partially moved here
    |         value borrowed here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -279,9 +279,9 @@ error[E0382]: borrow of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref.rs:44:9
    |
 LL |     let ref mut a @ [b, mut c] = [u(), u()];
-   |         ^^^^^^^^^^^^^-^^^^^^^^
-   |         |            |
-   |         |            value partially moved here
+   |         ^^^^^^^^^^^^^^^^-----^
+   |         |               |
+   |         |               value partially moved here
    |         value borrowed here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -290,16 +290,16 @@ error[E0382]: borrow of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref.rs:61:9
    |
 LL |         ref mut a @ Some([b, mut c]) => {}
-   |         ^^^^^^^^^^^^^^^^^^-^^^^^^^^^
-   |         |                 |
-   |         |                 value partially moved here
+   |         ^^^^^^^^^^^^^^^^^^^^^-----^^
+   |         |                    |
+   |         |                    value partially moved here
    |         value borrowed here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
 help: borrow this field in the pattern to avoid moving the value
    |
-LL |         ref mut a @ Some([ref b, mut c]) => {}
-   |                           ^^^
+LL |         ref mut a @ Some([b, ref mut c]) => {}
+   |                              ^^^
 
 error[E0382]: borrow of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref.rs:67:9
@@ -350,16 +350,16 @@ error[E0382]: borrow of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref.rs:82:9
    |
 LL |         ref mut a @ Some([b, mut c]) => {}
-   |         ^^^^^^^^^^^^^^^^^^-^^^^^^^^^
-   |         |                 |
-   |         |                 value partially moved here
+   |         ^^^^^^^^^^^^^^^^^^^^^-----^^
+   |         |                    |
+   |         |                    value partially moved here
    |         value borrowed here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
 help: borrow this field in the pattern to avoid moving the value
    |
-LL |         ref mut a @ Some([ref b, mut c]) => {}
-   |                           ^^^
+LL |         ref mut a @ Some([b, ref mut c]) => {}
+   |                              ^^^
 
 error[E0382]: borrow of moved value
   --> $DIR/borrowck-pat-by-move-and-ref.rs:13:11
@@ -397,9 +397,9 @@ error[E0382]: borrow of partially moved value
   --> $DIR/borrowck-pat-by-move-and-ref.rs:22:11
    |
 LL |     fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
-   |           ^^^^^^^^^^^^^-^^^^^^^^
-   |           |            |
-   |           |            value partially moved here
+   |           ^^^^^^^^^^^^^^^^-----^
+   |           |               |
+   |           |               value partially moved here
    |           value borrowed here after partial move
    |
    = note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
index d9b59504419..26182a1bc74 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
@@ -442,12 +442,12 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
   --> $DIR/borrowck-pat-ref-mut-and-ref.rs:123:9
    |
 LL |     let ref a @ (ref mut b, ref mut c) = (U, U);
-   |         ^^^^^^^^^^^^^^^^^^^^---------^
-   |         |                   |
-   |         |                   mutable borrow occurs here
+   |         ^^^^^^^^^---------^^^^^^^^^^^^
+   |         |        |
+   |         |        mutable borrow occurs here
    |         immutable borrow occurs here
 ...
-LL |     *c = U;
+LL |     *b = U;
    |     ------ mutable borrow later used here
 
 error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
@@ -466,12 +466,12 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
   --> $DIR/borrowck-pat-ref-mut-and-ref.rs:135:9
    |
 LL |     let ref a @ (ref mut b, ref mut c) = (U, U);
-   |         ^^^^^^^^^^^^^^^^^^^^---------^
-   |         |                   |
-   |         |                   mutable borrow occurs here
+   |         ^^^^^^^^^---------^^^^^^^^^^^^
+   |         |        |
+   |         |        mutable borrow occurs here
    |         immutable borrow occurs here
-...
-LL |     *c = U;
+LL |
+LL |     *b = U;
    |     ------ mutable borrow later used here
 
 error[E0382]: borrow of moved value
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs
index fdf92b66945..1d6d9acead1 100644
--- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs
+++ b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs
@@ -74,6 +74,6 @@ fn main() {
         };
         lam((mk(19), mk(20), mk(21), mk(22)));
     }
-    let expected = [2, 3, 6, 5, 7, 8, 12, 11, 9, 10, 13, 18, 14, 15, 16, 17, 19, 21, 20, 22, 4, 1];
+    let expected = [2, 3, 6, 5, 7, 8, 12, 11, 9, 10, 18, 13, 14, 15, 16, 17, 21, 19, 20, 22, 4, 1];
     assert_eq!(&*d.borrow(), &expected);
 }