about summary refs log tree commit diff
path: root/src/test/ui
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
parent9088807dd31f205b443fd2f6cef32f5ea295ecae (diff)
new fix method and update tests
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/borrowck/borrowck-move-error-with-note.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr12
-rw-r--r--src/test/ui/nll/move-errors.stderr24
-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
-rw-r--r--src/test/ui/span/dropck_direct_cycle_with_drop.stderr8
-rw-r--r--src/test/ui/span/send-is-not-static-std-sync-2.stderr2
10 files changed, 81 insertions, 81 deletions
diff --git a/src/test/ui/borrowck/borrowck-move-error-with-note.stderr b/src/test/ui/borrowck/borrowck-move-error-with-note.stderr
index de410a8b312..ead02414a62 100644
--- a/src/test/ui/borrowck/borrowck-move-error-with-note.stderr
+++ b/src/test/ui/borrowck/borrowck-move-error-with-note.stderr
@@ -1,4 +1,4 @@
-error[E0507]: cannot move out of `f.1` which is behind a shared reference
+error[E0507]: cannot move out of `f.0` which is behind a shared reference
   --> $DIR/borrowck-move-error-with-note.rs:11:11
    |
 LL |     match *f {
diff --git a/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr b/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr
index f7fa467c468..d3388e071aa 100644
--- a/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr
+++ b/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr
@@ -32,23 +32,23 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
   --> $DIR/borrowck-slice-pattern-element-loan-slice.rs:25:23
    |
 LL |     if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
-   |                    ------------- immutable borrow occurs here
+   |                                   ------------- immutable borrow occurs here
 ...
 LL |         if let [_, _, ref mut from_begin2, ..] = *s {
    |                       ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
 LL |             nop(&[from_begin2, from_end1, from_end3, from_end4]);
-   |                                                      --------- immutable borrow later used here
+   |                                           --------- immutable borrow later used here
 
 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
   --> $DIR/borrowck-slice-pattern-element-loan-slice.rs:28:26
    |
 LL |     if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
-   |                    ------------- immutable borrow occurs here
+   |                                   ------------- immutable borrow occurs here
 ...
 LL |         if let [_, _, _, ref mut from_begin3, ..] = *s {
    |                          ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
 LL |             nop(&[from_begin3, from_end1, from_end3, from_end4]);
-   |                                                      --------- immutable borrow later used here
+   |                                           --------- immutable borrow later used here
 
 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
   --> $DIR/borrowck-slice-pattern-element-loan-slice.rs:33:21
@@ -75,12 +75,12 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
   --> $DIR/borrowck-slice-pattern-element-loan-slice.rs:39:21
    |
 LL |     if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
-   |                                                  --------------- immutable borrow occurs here
+   |                              --------------- immutable borrow occurs here
 ...
 LL |         if let [.., ref mut from_end4, _, _, _] = *s {
    |                     ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
 LL |             nop(&[from_begin0, from_begin1, from_begin3, from_end4]);
-   |                                             ----------- immutable borrow later used here
+   |                                ----------- immutable borrow later used here
 
 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
   --> $DIR/borrowck-slice-pattern-element-loan-slice.rs:47:20
diff --git a/src/test/ui/nll/move-errors.stderr b/src/test/ui/nll/move-errors.stderr
index b69ed0bb875..0df326425ad 100644
--- a/src/test/ui/nll/move-errors.stderr
+++ b/src/test/ui/nll/move-errors.stderr
@@ -97,18 +97,6 @@ LL |         B::U(D(s)) => (),
    |                data moved here
    |                move occurs because `s` has type `String`, which does not implement the `Copy` trait
 
-error[E0507]: cannot move out of `*x.1` which is behind a shared reference
-  --> $DIR/move-errors.rs:92:11
-   |
-LL |     match x {
-   |           ^
-...
-LL |         (D(s), &t) => (),
-   |                 -
-   |                 |
-   |                 data moved here
-   |                 move occurs because `t` has type `String`, which does not implement the `Copy` trait
-
 error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
   --> $DIR/move-errors.rs:92:11
    |
@@ -121,6 +109,18 @@ LL |         (D(s), &t) => (),
    |            data moved here
    |            move occurs because `s` has type `String`, which does not implement the `Copy` trait
 
+error[E0507]: cannot move out of `*x.1` which is behind a shared reference
+  --> $DIR/move-errors.rs:92:11
+   |
+LL |     match x {
+   |           ^
+...
+LL |         (D(s), &t) => (),
+   |                 -
+   |                 |
+   |                 data moved here
+   |                 move occurs because `t` has type `String`, which does not implement the `Copy` trait
+
 error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
   --> $DIR/move-errors.rs:102:11
    |
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);
 }
diff --git a/src/test/ui/span/dropck_direct_cycle_with_drop.stderr b/src/test/ui/span/dropck_direct_cycle_with_drop.stderr
index e01c1f87428..07ae138ac71 100644
--- a/src/test/ui/span/dropck_direct_cycle_with_drop.stderr
+++ b/src/test/ui/span/dropck_direct_cycle_with_drop.stderr
@@ -8,7 +8,9 @@ LL | }
    | -
    | |
    | `d2` dropped here while still borrowed
-   | borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
+   | borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
+   |
+   = note: values in a scope are dropped in the opposite order they are defined
 
 error[E0597]: `d1` does not live long enough
   --> $DIR/dropck_direct_cycle_with_drop.rs:38:19
@@ -20,9 +22,7 @@ LL | }
    | -
    | |
    | `d1` dropped here while still borrowed
-   | borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
-   |
-   = note: values in a scope are dropped in the opposite order they are defined
+   | borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/span/send-is-not-static-std-sync-2.stderr b/src/test/ui/span/send-is-not-static-std-sync-2.stderr
index e4aa2aed24e..bcd07e11647 100644
--- a/src/test/ui/span/send-is-not-static-std-sync-2.stderr
+++ b/src/test/ui/span/send-is-not-static-std-sync-2.stderr
@@ -24,7 +24,7 @@ error[E0597]: `x` does not live long enough
   --> $DIR/send-is-not-static-std-sync-2.rs:31:25
    |
 LL |     let (_tx, rx) = {
-   |               -- borrow later used here
+   |          --- borrow later used here
 ...
 LL |         let _ = tx.send(&x);
    |                         ^^ borrowed value does not live long enough