]> git.lizzy.rs Git - rust.git/commitdiff
Bless UI tests
authorashtneoi <ashtneoi@gmail.com>
Mon, 13 Aug 2018 23:45:40 +0000 (16:45 -0700)
committerashtneoi <ashtneoi@gmail.com>
Wed, 15 Aug 2018 22:14:21 +0000 (15:14 -0700)
13 files changed:
src/test/ui/borrowck/borrowck-move-error-with-note.nll.stderr
src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
src/test/ui/borrowck/issue-51415.nll.stderr
src/test/ui/codemap_tests/overlapping_spans.nll.stderr
src/test/ui/issues/issue-12567.nll.stderr
src/test/ui/issues/issue-20801.nll.stderr
src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.nll.stderr
src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.nll.stderr
src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr
src/test/ui/nll/cannot-move-block-spans.nll.stderr
src/test/ui/nll/move-errors.stderr
src/test/ui/suggestions/dont-suggest-ref.stderr

index 1b913471924b799a19fbcefa11978ce2bef67d0a..2df520a936c9d4a9975563d5eb6221917fda2853 100644 (file)
@@ -5,14 +5,24 @@ LL |     match *f {             //~ ERROR cannot move out of
    |           ^^
    |           |
    |           cannot move out of borrowed content
-   |           help: consider removing this dereference operator: `f`
+   |           help: consider removing the `*`: `f`
 LL |                            //~| cannot move out
 LL |         Foo::Foo1(num1,
-   |                   ---- move occurs because num1 has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
+   |                   ---- data moved here
 LL |                   num2) => (),
-   |                   ---- move occurs because num2 has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
+   |                   ---- ...and here
 LL |         Foo::Foo2(num) => (),
-   |                   --- move occurs because num has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
+   |                   --- ...and here
+   |
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/borrowck-move-error-with-note.rs:23:19
+   |
+LL |         Foo::Foo1(num1,
+   |                   ^^^^
+LL |                   num2) => (),
+   |                   ^^^^
+LL |         Foo::Foo2(num) => (),
+   |                   ^^^
 
 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
   --> $DIR/borrowck-move-error-with-note.rs:39:11
@@ -23,12 +33,15 @@ LL |     match (S {f: "foo".to_string(), g: "bar".to_string()}) {
 LL |             f: _s,
    |                -- data moved here
 LL |             g: _t
-   |                -- ... and here
-help: to prevent move, use ref or ref mut
+   |                -- ...and here
    |
-LL |             f: ref _s,
-LL |             g: ref _t
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/borrowck-move-error-with-note.rs:42:16
    |
+LL |             f: _s,
+   |                ^^
+LL |             g: _t
+   |                ^^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-move-error-with-note.rs:57:11
@@ -37,10 +50,16 @@ LL |     match a.a {           //~ ERROR cannot move out of
    |           ^^^
    |           |
    |           cannot move out of borrowed content
-   |           help: consider using a reference instead: `&a.a`
+   |           help: consider borrowing here: `&a.a`
 LL |                           //~| cannot move out
 LL |         n => {
-   |         - move occurs because n has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
+   |         - data moved here
+   |
+note: move occurs because `n` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-error-with-note.rs:59:9
+   |
+LL |         n => {
+   |         ^
 
 error: aborting due to 3 previous errors
 
index 95a7894d532546e1f8dd942b7c11e536c906eb22..f3430ba4e06c9038310a8f087594447e8b89dbce 100644 (file)
@@ -7,14 +7,23 @@ LL |                 &[Foo { string: a },
    |                                 - data moved here
 ...
 LL |                   Foo { string: b }] => {
-   |                                 - ... and here
-help: to prevent move, use ref or ref mut
+   |                                 - ...and here
    |
-LL |                 &[Foo { string: ref a },
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
+   |
+LL |                 &[Foo { string: a },
+   |                                 ^
+...
+LL |                   Foo { string: b }] => {
+   |                                 ^
+help: consider removing the `&`
+   |
+LL |                 [Foo { string: a },
 LL |                 //~^ ERROR cannot move out of type `[Foo]`
 LL |                 //~| cannot move out
 LL |                 //~| to prevent move
-LL |                   Foo { string: ref b }] => {
+LL |                   Foo { string: b }] => {
    |
 
 error: aborting due to previous error
index 2779132590e2c00b57e1b06f1a9d372b2af166fd..d5b17119d85f52abeb645cf07b1f5b8c24f2ec8e 100644 (file)
@@ -28,10 +28,21 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
 LL |     match vec {
    |           ^^^ cannot move out of here
 LL |         &mut [_a, //~ ERROR cannot move out
-   |               --
-   |               |
-   |               data moved here
-   |               help: to prevent move, use ref or ref mut: `ref _a`
+   |               -- data moved here
+   |
+note: move occurs because `_a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-vec-pattern-nesting.rs:44:15
+   |
+LL |         &mut [_a, //~ ERROR cannot move out
+   |               ^^
+help: consider removing the `&mut`
+   |
+LL |         [_a, //~ ERROR cannot move out
+LL |             //~| cannot move out
+LL |             //~| to prevent move
+LL |             ..
+LL |         ] => {
+   |
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
   --> $DIR/borrowck-vec-pattern-nesting.rs:57:13
@@ -40,7 +51,7 @@ LL |     let a = vec[0]; //~ ERROR cannot move out
    |             ^^^^^^
    |             |
    |             cannot move out of here
-   |             help: consider using a reference instead: `&vec[0]`
+   |             help: consider borrowing here: `&vec[0]`
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
   --> $DIR/borrowck-vec-pattern-nesting.rs:64:11
@@ -49,10 +60,19 @@ LL |     match vec {
    |           ^^^ cannot move out of here
 ...
 LL |          _b] => {}
-   |          --
-   |          |
-   |          data moved here
-   |          help: to prevent move, use ref or ref mut: `ref _b`
+   |          -- data moved here
+   |
+note: move occurs because `_b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-vec-pattern-nesting.rs:67:10
+   |
+LL |          _b] => {}
+   |          ^^
+help: consider removing the `&mut`
+   |
+LL |         [ //~ ERROR cannot move out
+LL |         //~^ cannot move out
+LL |          _b] => {}
+   |
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
   --> $DIR/borrowck-vec-pattern-nesting.rs:70:13
@@ -61,7 +81,7 @@ LL |     let a = vec[0]; //~ ERROR cannot move out
    |             ^^^^^^
    |             |
    |             cannot move out of here
-   |             help: consider using a reference instead: `&vec[0]`
+   |             help: consider borrowing here: `&vec[0]`
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
   --> $DIR/borrowck-vec-pattern-nesting.rs:77:11
@@ -69,14 +89,18 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
 LL |     match vec {
    |           ^^^ cannot move out of here
 LL |         &mut [_a, _b, _c] => {}  //~ ERROR cannot move out
-   |               --  --  -- ... and here
-   |               |   |
-   |               |   ... and here
-   |               data moved here
-help: to prevent move, use ref or ref mut
-   |
-LL |         &mut [ref _a, ref _b, ref _c] => {}  //~ ERROR cannot move out
-   |               ^^^^^^  ^^^^^^  ^^^^^^
+   |         -----------------
+   |         |     |   |   |
+   |         |     |   |   ...and here
+   |         |     |   ...and here
+   |         |     data moved here
+   |         help: consider removing the `&mut`: `[_a, _b, _c]`
+   |
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/borrowck-vec-pattern-nesting.rs:78:15
+   |
+LL |         &mut [_a, _b, _c] => {}  //~ ERROR cannot move out
+   |               ^^  ^^  ^^
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
   --> $DIR/borrowck-vec-pattern-nesting.rs:82:13
@@ -85,7 +109,7 @@ LL |     let a = vec[0]; //~ ERROR cannot move out
    |             ^^^^^^
    |             |
    |             cannot move out of here
-   |             help: consider using a reference instead: `&vec[0]`
+   |             help: consider borrowing here: `&vec[0]`
 
 error: aborting due to 8 previous errors
 
index 20713c3392e8e9c23e0f2cfe66337beee321ede3..d4340938eebc14880e7b4409021344c26f733c86 100644 (file)
@@ -5,8 +5,13 @@ LL |     let opt = a.iter().enumerate().find(|(_, &s)| {
    |                                          ^^^^^-^
    |                                          |    |
    |                                          |    data moved here
-   |                                          |    help: to prevent move, use ref or ref mut: `ref s`
    |                                          cannot move out of borrowed content
+   |
+note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/issue-51415.rs:16:47
+   |
+LL |     let opt = a.iter().enumerate().find(|(_, &s)| {
+   |                                               ^
 
 error: aborting due to previous error
 
index a1fbcf1430db93b2b4a40c3077ee87db39a4cce9..e334472f9d6e1b26cba8b06eb20fe2ccdd999cfe 100644 (file)
@@ -4,10 +4,13 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
 LL |     match (S {f:"foo".to_string()}) {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
 LL |         S {f:_s} => {} //~ ERROR cannot move out
-   |              --
-   |              |
-   |              data moved here
-   |              help: to prevent move, use ref or ref mut: `ref _s`
+   |              -- data moved here
+   |
+note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/overlapping_spans.rs:21:14
+   |
+LL |         S {f:_s} => {} //~ ERROR cannot move out
+   |              ^^
 
 error: aborting due to previous error
 
index 29bda252b9115f180495870e819928142669be9c..72d21d47d86fa765985da974e0b8b2664837d7fa 100644 (file)
@@ -8,15 +8,16 @@ LL |         (&[], &[hd, ..]) | (&[hd, ..], &[])
    |                 -- data moved here
 ...
 LL |         (&[hd1, ..], &[hd2, ..])
-   |                        --- ... and here
-help: to prevent move, use ref or ref mut
+   |                        --- ...and here
    |
-LL |         (&[], &[ref hd, ..]) | (&[hd, ..], &[])
-LL |             => println!("one empty"),
-LL |         //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice
-LL |         //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice
-LL |         (&[hd1, ..], &[ref hd2, ..])
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/issue-12567.rs:16:17
    |
+LL |         (&[], &[hd, ..]) | (&[hd, ..], &[])
+   |                 ^^
+...
+LL |         (&[hd1, ..], &[hd2, ..])
+   |                        ^^^
 
 error[E0508]: cannot move out of type `[T]`, a non-copy slice
   --> $DIR/issue-12567.rs:14:11
@@ -28,15 +29,16 @@ LL |         (&[], &[hd, ..]) | (&[hd, ..], &[])
    |                 -- data moved here
 ...
 LL |         (&[hd1, ..], &[hd2, ..])
-   |            --- ... and here
-help: to prevent move, use ref or ref mut
+   |            --- ...and here
    |
-LL |         (&[], &[ref hd, ..]) | (&[hd, ..], &[])
-LL |             => println!("one empty"),
-LL |         //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice
-LL |         //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice
-LL |         (&[ref hd1, ..], &[hd2, ..])
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/issue-12567.rs:16:17
    |
+LL |         (&[], &[hd, ..]) | (&[hd, ..], &[])
+   |                 ^^
+...
+LL |         (&[hd1, ..], &[hd2, ..])
+   |            ^^^
 
 error: aborting due to 2 previous errors
 
index fc94cc423c53138d3c35bcbbdfef22648835772e..3a6784eed67dd35d3adaaadb90b1bcd59d38ebc7 100644 (file)
@@ -5,7 +5,7 @@ LL |     let a = unsafe { *mut_ref() };
    |                      ^^^^^^^^^^
    |                      |
    |                      cannot move out of borrowed content
-   |                      help: consider using a reference instead: `&*mut_ref()`
+   |                      help: consider removing the `*`: `mut_ref()`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/issue-20801.rs:39:22
@@ -14,7 +14,7 @@ LL |     let b = unsafe { *imm_ref() };
    |                      ^^^^^^^^^^
    |                      |
    |                      cannot move out of borrowed content
-   |                      help: consider using a reference instead: `&*imm_ref()`
+   |                      help: consider removing the `*`: `imm_ref()`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/issue-20801.rs:42:22
@@ -23,7 +23,7 @@ LL |     let c = unsafe { *mut_ptr() };
    |                      ^^^^^^^^^^
    |                      |
    |                      cannot move out of borrowed content
-   |                      help: consider using a reference instead: `&*mut_ptr()`
+   |                      help: consider removing the `*`: `mut_ptr()`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/issue-20801.rs:45:22
@@ -32,7 +32,7 @@ LL |     let d = unsafe { *const_ptr() };
    |                      ^^^^^^^^^^^^
    |                      |
    |                      cannot move out of borrowed content
-   |                      help: consider using a reference instead: `&*const_ptr()`
+   |                      help: consider removing the `*`: `const_ptr()`
 
 error: aborting due to 4 previous errors
 
index 162e43abc0ac47a0e915200ff2df12e647227194..9020d3778c3730820347651be4554a9b7d9c1f0b 100644 (file)
@@ -5,7 +5,7 @@ LL |     let e = f.v[0]; //~ ERROR cannot move out of indexed content
    |             ^^^^^^
    |             |
    |             cannot move out of borrowed content
-   |             help: consider using a reference instead: `&f.v[0]`
+   |             help: consider borrowing here: `&f.v[0]`
 
 error: aborting due to previous error
 
index cd75be24589dfbf443bd00671ba8dc3e43056891..a80e9a5fe091f70343247033078fb2881a09d61d 100644 (file)
@@ -5,9 +5,15 @@ LL |     let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
    |          -  -    ^^^^
    |          |  |    |
    |          |  |    cannot move out of borrowed content
-   |          |  |    help: consider using a reference instead: `&x[0]`
-   |          |  move occurs because b has type `std::string::String`, which does not implement the `Copy` trait
-   |          move occurs because a has type `std::string::String`, which does not implement the `Copy` trait
+   |          |  |    help: consider borrowing here: `&x[0]`
+   |          |  ...and here
+   |          data moved here
+   |
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/issue-40402-2.rs:15:10
+   |
+LL |     let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
+   |          ^  ^
 
 error: aborting due to previous error
 
index 94f2074b45d4c0a444f38b6606876e5eefdb3097..1f22ab148185296bbf3ca71abe0a75ca06630a3d 100644 (file)
@@ -5,10 +5,16 @@ LL |             match hellothere.x { //~ ERROR cannot move out
    |                   ^^^^^^^^^^^^
    |                   |
    |                   cannot move out of borrowed content
-   |                   help: consider using a reference instead: `&hellothere.x`
+   |                   help: consider borrowing here: `&hellothere.x`
 ...
 LL |                 box E::Bar(x) => println!("{}", x.to_string()),
-   |                            - move occurs because x has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
+   |                            - data moved here
+   |
+note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
+  --> $DIR/moves-based-on-type-block-bad.rs:37:28
+   |
+LL |                 box E::Bar(x) => println!("{}", x.to_string()),
+   |                            ^
 
 error: aborting due to previous error
 
index 814e11b6f0682f5feccb0a49fce9885b48d65dbd..6a4c8f2e8d81570161b7d251523acb9c6483235f 100644 (file)
@@ -5,7 +5,7 @@ LL |     let x = { *r }; //~ ERROR
    |               ^^
    |               |
    |               cannot move out of borrowed content
-   |               help: consider removing this dereference operator: `r`
+   |               help: consider removing the `*`: `r`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/cannot-move-block-spans.rs:16:22
@@ -14,7 +14,7 @@ LL |     let y = unsafe { *r }; //~ ERROR
    |                      ^^
    |                      |
    |                      cannot move out of borrowed content
-   |                      help: consider removing this dereference operator: `r`
+   |                      help: consider removing the `*`: `r`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/cannot-move-block-spans.rs:17:26
@@ -23,7 +23,7 @@ LL |     let z = loop { break *r; }; //~ ERROR
    |                          ^^
    |                          |
    |                          cannot move out of borrowed content
-   |                          help: consider removing this dereference operator: `r`
+   |                          help: consider removing the `*`: `r`
 
 error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
   --> $DIR/cannot-move-block-spans.rs:21:15
@@ -32,7 +32,7 @@ LL |     let x = { arr[0] }; //~ ERROR
    |               ^^^^^^
    |               |
    |               cannot move out of here
-   |               help: consider using a reference instead: `&arr[0]`
+   |               help: consider borrowing here: `&arr[0]`
 
 error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
   --> $DIR/cannot-move-block-spans.rs:22:22
@@ -41,7 +41,7 @@ LL |     let y = unsafe { arr[0] }; //~ ERROR
    |                      ^^^^^^
    |                      |
    |                      cannot move out of here
-   |                      help: consider using a reference instead: `&arr[0]`
+   |                      help: consider borrowing here: `&arr[0]`
 
 error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
   --> $DIR/cannot-move-block-spans.rs:23:26
@@ -50,7 +50,7 @@ LL |     let z = loop { break arr[0]; }; //~ ERROR
    |                          ^^^^^^
    |                          |
    |                          cannot move out of here
-   |                          help: consider using a reference instead: `&arr[0]`
+   |                          help: consider borrowing here: `&arr[0]`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/cannot-move-block-spans.rs:27:38
@@ -59,7 +59,7 @@ LL |     let x = { let mut u = 0; u += 1; *r }; //~ ERROR
    |                                      ^^
    |                                      |
    |                                      cannot move out of borrowed content
-   |                                      help: consider removing this dereference operator: `r`
+   |                                      help: consider removing the `*`: `r`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/cannot-move-block-spans.rs:28:45
@@ -68,7 +68,7 @@ LL |     let y = unsafe { let mut u = 0; u += 1; *r }; //~ ERROR
    |                                             ^^
    |                                             |
    |                                             cannot move out of borrowed content
-   |                                             help: consider removing this dereference operator: `r`
+   |                                             help: consider removing the `*`: `r`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/cannot-move-block-spans.rs:29:49
@@ -77,7 +77,7 @@ LL |     let z = loop { let mut u = 0; u += 1; break *r; u += 2; }; //~ ERROR
    |                                                 ^^
    |                                                 |
    |                                                 cannot move out of borrowed content
-   |                                                 help: consider removing this dereference operator: `r`
+   |                                                 help: consider removing the `*`: `r`
 
 error: aborting due to 9 previous errors
 
index 53d60d3f6d649a4b4ec0b3d9efbc1dc8c14f4ba7..592768363096cae2d0d60a37ee35a0eefb81d24b 100644 (file)
@@ -5,7 +5,7 @@ LL |     let b = *a;
    |             ^^
    |             |
    |             cannot move out of borrowed content
-   |             help: consider removing this dereference operator: `a`
+   |             help: consider removing the `*`: `a`
 
 error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
   --> $DIR/move-errors.rs:25:13
@@ -14,7 +14,7 @@ LL |     let b = a[0];
    |             ^^^^
    |             |
    |             cannot move out of here
-   |             help: consider using a reference instead: `&a[0]`
+   |             help: consider borrowing here: `&a[0]`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/move-errors.rs:32:13
@@ -23,7 +23,7 @@ LL |     let s = **r;
    |             ^^^
    |             |
    |             cannot move out of borrowed content
-   |             help: consider using a reference instead: `&**r`
+   |             help: consider removing the `*`: `*r`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/move-errors.rs:40:13
@@ -32,7 +32,7 @@ LL |     let s = *r;
    |             ^^
    |             |
    |             cannot move out of borrowed content
-   |             help: consider using a reference instead: `&*r`
+   |             help: consider removing the `*`: `r`
 
 error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
   --> $DIR/move-errors.rs:45:13
@@ -41,7 +41,7 @@ LL |     let a = [A("".to_string())][0];
    |             ^^^^^^^^^^^^^^^^^^^^^^
    |             |
    |             cannot move out of here
-   |             help: consider using a reference instead: `&[A("".to_string())][0]`
+   |             help: consider borrowing here: `&[A("".to_string())][0]`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/move-errors.rs:51:16
@@ -50,8 +50,14 @@ LL |     let A(s) = *a;
    |           -    ^^
    |           |    |
    |           |    cannot move out of borrowed content
-   |           |    help: consider removing this dereference operator: `a`
-   |           move occurs because s has type `std::string::String`, which does not implement the `Copy` trait
+   |           |    help: consider removing the `*`: `a`
+   |           data moved here
+   |
+note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/move-errors.rs:51:11
+   |
+LL |     let A(s) = *a;
+   |           ^
 
 error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
   --> $DIR/move-errors.rs:57:19
@@ -60,7 +66,12 @@ LL |     let C(D(s)) = c;
    |             -     ^ cannot move out of here
    |             |
    |             data moved here
-   |             help: to prevent move, use ref or ref mut: `ref s`
+   |
+note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/move-errors.rs:57:13
+   |
+LL |     let C(D(s)) = c;
+   |             ^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/move-errors.rs:64:9
@@ -75,12 +86,20 @@ LL |     match x[0] {
    |           ^^^^
    |           |
    |           cannot move out of here
-   |           help: consider using a reference instead: `&x[0]`
+   |           help: consider borrowing here: `&x[0]`
 LL |     //~^ ERROR
 LL |         B::U(d) => (),
-   |              - move occurs because d has type `D`, which does not implement the `Copy` trait
+   |              - data moved here
 LL |         B::V(s) => (),
-   |              - move occurs because s has type `std::string::String`, which does not implement the `Copy` trait
+   |              - ...and here
+   |
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/move-errors.rs:89:14
+   |
+LL |         B::U(d) => (),
+   |              ^
+LL |         B::V(s) => (),
+   |              ^
 
 error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
   --> $DIR/move-errors.rs:96:11
@@ -89,10 +108,13 @@ LL |     match x {
    |           ^ cannot move out of here
 ...
 LL |         B::U(D(s)) => (),
-   |                -
-   |                |
-   |                data moved here
-   |                help: to prevent move, use ref or ref mut: `ref s`
+   |                - data moved here
+   |
+note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/move-errors.rs:99:16
+   |
+LL |         B::U(D(s)) => (),
+   |                ^
 
 error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
   --> $DIR/move-errors.rs:105:11
@@ -101,10 +123,13 @@ LL |     match x {
    |           ^ cannot move out of here
 ...
 LL |         (D(s), &t) => (),
-   |            -
-   |            |
-   |            data moved here
-   |            help: to prevent move, use ref or ref mut: `ref s`
+   |            - data moved here
+   |
+note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/move-errors.rs:108:12
+   |
+LL |         (D(s), &t) => (),
+   |            ^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/move-errors.rs:105:11
@@ -113,10 +138,13 @@ LL |     match x {
    |           ^ cannot move out of borrowed content
 ...
 LL |         (D(s), &t) => (),
-   |                 -
-   |                 |
-   |                 data moved here
-   |                 help: to prevent move, use ref or ref mut: `ref t`
+   |                 - data moved here
+   |
+note: move occurs because `t` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/move-errors.rs:108:17
+   |
+LL |         (D(s), &t) => (),
+   |                 ^
 
 error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
   --> $DIR/move-errors.rs:115:11
@@ -125,13 +153,15 @@ LL |     match x {
    |           ^ cannot move out of here
 LL |     //~^ ERROR
 LL |         F(s, mut t) => (),
-   |           -  ----- ... and here
+   |           -  ----- ...and here
    |           |
    |           data moved here
-help: to prevent move, use ref or ref mut
    |
-LL |         F(ref s, ref mut t) => (),
-   |           ^^^^^  ^^^^^^^^^
+note: move occurs because these variables have types that don't implement the `Copy` trait
+  --> $DIR/move-errors.rs:117:11
+   |
+LL |         F(s, mut t) => (),
+   |           ^  ^^^^^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/move-errors.rs:123:11
@@ -140,10 +170,16 @@ LL |     match *x {
    |           ^^
    |           |
    |           cannot move out of borrowed content
-   |           help: consider removing this dereference operator: `x`
+   |           help: consider removing the `*`: `x`
 LL |     //~^ ERROR
 LL |         Ok(s) | Err(s) => (),
-   |            - move occurs because s has type `std::string::String`, which does not implement the `Copy` trait
+   |            - data moved here
+   |
+note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/move-errors.rs:125:12
+   |
+LL |         Ok(s) | Err(s) => (),
+   |            ^
 
 error: aborting due to 14 previous errors
 
index 00fe78d9164744493feb68b3ee31c425c8b5dc4e..7d365e8788f0080dc260874dcabd366c3c0c66ae 100644 (file)
@@ -524,7 +524,7 @@ LL |         &mut Either::One(_t) => (),
    |                          -- data moved here
 ...
 LL |         &mut Either::Two(_t) => (),
-   |                          -- ... and here
+   |                          -- ...and here
    |
 note: move occurs because these variables have types that don't implement the `Copy` trait
   --> $DIR/dont-suggest-ref.rs:233:26
@@ -705,7 +705,7 @@ LL |         //~^ ERROR cannot move
 LL |         (&mut Either::One(_t),) => (),
    |                           -- data moved here
 LL |         (&mut Either::Two(_t),) => (),
-   |                           -- ... and here
+   |                           -- ...and here
    |
 note: move occurs because these variables have types that don't implement the `Copy` trait
   --> $DIR/dont-suggest-ref.rs:290:27
@@ -937,7 +937,7 @@ error[E0507]: cannot move out of borrowed content
 LL |     let &(X(_t), X(_u)) = &(x.clone(), x.clone());
    |         ---------------   ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
    |         |   |      |
-   |         |   |      ... and here
+   |         |   |      ...and here
    |         |   data moved here
    |         help: consider removing the `&`: `(X(_t), X(_u))`
    |
@@ -953,7 +953,7 @@ error[E0507]: cannot move out of borrowed content
 LL |     if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { }
    |            -----------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
    |            |             |                |
-   |            |             |                ... and here
+   |            |             |                ...and here
    |            |             data moved here
    |            help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -969,7 +969,7 @@ error[E0507]: cannot move out of borrowed content
 LL |     while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { }
    |               -----------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
    |               |             |                |
-   |               |             |                ... and here
+   |               |             |                ...and here
    |               |             data moved here
    |               help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -986,12 +986,12 @@ LL |     match &(e.clone(), e.clone()) {
    |           ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
 LL |         //~^ ERROR cannot move
 LL |         &(Either::One(_t), Either::Two(_u)) => (),
-   |                       --               -- ... and here
+   |                       --               -- ...and here
    |                       |
    |                       data moved here
 ...
 LL |         &(Either::Two(_t), Either::One(_u)) => (),
-   |                       -- ... and here  -- ... and here
+   |                       -- ...and here   -- ...and here
    |
 note: move occurs because these variables have types that don't implement the `Copy` trait
   --> $DIR/dont-suggest-ref.rs:391:23
@@ -1019,7 +1019,7 @@ LL |         //~^ ERROR cannot move
 LL |         &(Either::One(_t), Either::Two(_u))
    |         -----------------------------------
    |         |             |                |
-   |         |             |                ... and here
+   |         |             |                ...and here
    |         |             data moved here
    |         help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1038,7 +1038,7 @@ LL |         //~^ ERROR cannot move
 LL |         &(Either::One(_t), Either::Two(_u)) => (),
    |         -----------------------------------
    |         |             |                |
-   |         |             |                ... and here
+   |         |             |                ...and here
    |         |             data moved here
    |         help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1057,7 +1057,7 @@ LL |         //~^ ERROR cannot move
 LL |         &(Either::One(_t), Either::Two(_u)) => (),
    |         -----------------------------------
    |         |             |                |
-   |         |             |                ... and here
+   |         |             |                ...and here
    |         |             data moved here
    |         help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1073,7 +1073,7 @@ error[E0507]: cannot move out of borrowed content
 LL |     let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone());
    |         -------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
    |         |       |      |
-   |         |       |      ... and here
+   |         |       |      ...and here
    |         |       data moved here
    |         help: consider removing the `&mut`: `(X(_t), X(_u))`
    |
@@ -1089,7 +1089,7 @@ error[E0507]: cannot move out of borrowed content
 LL |     if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { }
    |            ---------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
    |            |                 |                |
-   |            |                 |                ... and here
+   |            |                 |                ...and here
    |            |                 data moved here
    |            help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1105,7 +1105,7 @@ error[E0507]: cannot move out of borrowed content
 LL |     while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { }
    |               ---------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
    |               |                 |                |
-   |               |                 |                ... and here
+   |               |                 |                ...and here
    |               |                 data moved here
    |               help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1122,12 +1122,12 @@ LL |     match &mut (em.clone(), em.clone()) {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
 LL |         //~^ ERROR cannot move
 LL |         &mut (Either::One(_t), Either::Two(_u)) => (),
-   |                           --               -- ... and here
+   |                           --               -- ...and here
    |                           |
    |                           data moved here
 ...
 LL |         &mut (Either::Two(_t), Either::One(_u)) => (),
-   |                           -- ... and here  -- ... and here
+   |                           -- ...and here   -- ...and here
    |
 note: move occurs because these variables have types that don't implement the `Copy` trait
   --> $DIR/dont-suggest-ref.rs:443:27
@@ -1155,7 +1155,7 @@ LL |         //~^ ERROR cannot move
 LL |         &mut (Either::One(_t), Either::Two(_u))
    |         ---------------------------------------
    |         |                 |                |
-   |         |                 |                ... and here
+   |         |                 |                ...and here
    |         |                 data moved here
    |         help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1174,7 +1174,7 @@ LL |         //~^ ERROR cannot move
 LL |         &mut (Either::One(_t), Either::Two(_u)) => (),
    |         ---------------------------------------
    |         |                 |                |
-   |         |                 |                ... and here
+   |         |                 |                ...and here
    |         |                 data moved here
    |         help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1193,7 +1193,7 @@ LL |         //~^ ERROR cannot move
 LL |         &mut (Either::One(_t), Either::Two(_u)) => (),
    |         ---------------------------------------
    |         |                 |                |
-   |         |                 |                ... and here
+   |         |                 |                ...and here
    |         |                 data moved here
    |         help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1212,7 +1212,7 @@ LL |         //~^ ERROR cannot move
 LL |         &mut (Either::One(_t), Either::Two(_u)) => (),
    |         ---------------------------------------
    |         |                 |                |
-   |         |                 |                ... and here
+   |         |                 |                ...and here
    |         |                 data moved here
    |         help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
    |
@@ -1290,7 +1290,7 @@ error[E0507]: cannot move out of borrowed content
 LL |     fn f5(&(X(_t), X(_u)): &(X, X)) { }
    |           ^^^^--^^^^^--^^
    |           |   |      |
-   |           |   |      ... and here
+   |           |   |      ...and here
    |           |   data moved here
    |           cannot move out of borrowed content
    |           help: consider removing the `&`: `(X(_t), X(_u))`
@@ -1307,7 +1307,7 @@ error[E0507]: cannot move out of borrowed content
 LL |     fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { }
    |           ^^^^^^^^--^^^^^--^^
    |           |       |      |
-   |           |       |      ... and here
+   |           |       |      ...and here
    |           |       data moved here
    |           cannot move out of borrowed content
    |           help: consider removing the `&mut`: `(X(_t), X(_u))`