]> git.lizzy.rs Git - rust.git/commitdiff
Bless tests
authorashtneoi <ashtneoi@gmail.com>
Tue, 14 Aug 2018 19:38:37 +0000 (12:38 -0700)
committerashtneoi <ashtneoi@gmail.com>
Wed, 15 Aug 2018 22:14:21 +0000 (15:14 -0700)
16 files changed:
src/test/ui/E0508-fail.mir.stderr
src/test/ui/access-mode-in-closures.nll.stderr
src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.nll.stderr
src/test/ui/borrowck/borrowck-issue-2657-2.nll.stderr
src/test/ui/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr
src/test/ui/borrowck/borrowck-move-in-irrefut-pat.ast.nll.stderr
src/test/ui/borrowck/borrowck-move-in-irrefut-pat.mir.stderr
src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr
src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr
src/test/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.nll.stderr
src/test/ui/borrowck/borrowck-overloaded-index-move-from-vec.nll.stderr
src/test/ui/by-move-pattern-binding.nll.stderr
src/test/ui/check-static-values-constraints.nll.stderr
src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-let.nll.stderr
src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-match.nll.stderr
src/test/ui/moves/move-out-of-slice-1.nll.stderr

index faf7411af317b15b2f8faf13cb99ff2a052cd173..fda6c24dc8710a8e5d97bf5bf119d843e95cb793 100644 (file)
@@ -5,7 +5,7 @@ LL |     let _value = array[0];  //[ast]~ ERROR [E0508]
    |                  ^^^^^^^^
    |                  |
    |                  cannot move out of here
-   |                  help: consider using a reference instead: `&array[0]`
+   |                  help: consider borrowing here: `&array[0]`
 
 error: aborting due to previous error
 
index 2aa8f1c3813090291fbca72df73f78ee8f2f8785..b9de60f43f703f72c82096ffa92e995bea3c211d 100644 (file)
@@ -2,10 +2,16 @@ error[E0507]: cannot move out of borrowed content
   --> $DIR/access-mode-in-closures.rs:19:15
    |
 LL |         match *s { sty(v) => v } //~ ERROR cannot move out
-   |               ^^       - move occurs because v has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
+   |               ^^       - data moved here
    |               |
    |               cannot move out of borrowed content
-   |               help: consider removing this dereference operator: `s`
+   |               help: consider removing the `*`: `s`
+   |
+note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
+  --> $DIR/access-mode-in-closures.rs:19:24
+   |
+LL |         match *s { sty(v) => v } //~ ERROR cannot move out
+   |                        ^
 
 error: aborting due to previous error
 
index f9e517def14060e049e7d8629c1058e35691cc4b..25eb69ad9377dfe21b260a35ad50463847956d75 100644 (file)
@@ -2,28 +2,46 @@ error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:15
    |
 LL |     for &a in x.iter() {    //~ ERROR cannot move out
-   |          -    ^^^^^^^^ cannot move out of borrowed content
-   |          |
-   |          data moved here
-   |          help: to prevent move, use ref or ref mut: `ref a`
+   |         --    ^^^^^^^^ cannot move out of borrowed content
+   |         ||
+   |         |data moved here
+   |         help: consider removing the `&`: `a`
+   |
+note: move occurs because `a` has type `&mut i32`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:10
+   |
+LL |     for &a in x.iter() {    //~ ERROR cannot move out
+   |          ^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:15
    |
 LL |     for &a in &f.a {  //~ ERROR cannot move out
-   |          -    ^^^^ cannot move out of borrowed content
-   |          |
-   |          data moved here
-   |          help: to prevent move, use ref or ref mut: `ref a`
+   |         --    ^^^^ cannot move out of borrowed content
+   |         ||
+   |         |data moved here
+   |         help: consider removing the `&`: `a`
+   |
+note: move occurs because `a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:10
+   |
+LL |     for &a in &f.a {  //~ ERROR cannot move out
+   |          ^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:15
    |
 LL |     for &a in x.iter() {    //~ ERROR cannot move out
-   |          -    ^^^^^^^^ cannot move out of borrowed content
-   |          |
-   |          data moved here
-   |          help: to prevent move, use ref or ref mut: `ref a`
+   |         --    ^^^^^^^^ cannot move out of borrowed content
+   |         ||
+   |         |data moved here
+   |         help: consider removing the `&`: `a`
+   |
+note: move occurs because `a` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:10
+   |
+LL |     for &a in x.iter() {    //~ ERROR cannot move out
+   |          ^
 
 error: aborting due to 3 previous errors
 
index 55c6a40d281bc0c55dc1c9d02b52de582e9c3364..cdbfab8bd054a1903c2d53ce953bc577d7f9faeb 100644 (file)
@@ -5,7 +5,7 @@ LL |         let _b = *y; //~ ERROR cannot move out
    |                  ^^
    |                  |
    |                  cannot move out of borrowed content
-   |                  help: consider removing this dereference operator: `y`
+   |                  help: consider removing the `*`: `y`
 
 error: aborting due to previous error
 
index 4f692bfc55e427cb92ed903d240d51e4269da96c..f823a6f08d789485e47546b7e9fa34f4ec5f1f34 100644 (file)
@@ -5,7 +5,7 @@ LL |     let y = *x; //~ ERROR cannot move out of dereference of raw pointer
    |             ^^
    |             |
    |             cannot move out of borrowed content
-   |             help: consider using a reference instead: `&*x`
+   |             help: consider removing the `*`: `x`
 
 error: aborting due to previous error
 
index f670936dbac17b7a4bee7dac9c2e38d198641daa..49c2ec0dcf4e7c996e77b3f918f482664288f74f 100644 (file)
@@ -5,8 +5,14 @@ LL | fn arg_item(&_x: &String) {}
    |             ^--
    |             ||
    |             |data moved here
-   |             |help: to prevent move, use ref or ref mut: `ref _x`
    |             cannot move out of borrowed content
+   |             help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:16:14
+   |
+LL | fn arg_item(&_x: &String) {}
+   |              ^^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-move-in-irrefut-pat.rs:21:11
@@ -15,17 +21,29 @@ LL |     with(|&_x| ())
    |           ^--
    |           ||
    |           |data moved here
-   |           |help: to prevent move, use ref or ref mut: `ref _x`
    |           cannot move out of borrowed content
+   |           help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:21:12
+   |
+LL |     with(|&_x| ())
+   |            ^^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-move-in-irrefut-pat.rs:27:15
    |
 LL |     let &_x = &"hi".to_string();
-   |          --   ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
-   |          |
-   |          data moved here
-   |          help: to prevent move, use ref or ref mut: `ref _x`
+   |         ---   ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
+   |         ||
+   |         |data moved here
+   |         help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:27:10
+   |
+LL |     let &_x = &"hi".to_string();
+   |          ^^
 
 error: aborting due to 3 previous errors
 
index f670936dbac17b7a4bee7dac9c2e38d198641daa..49c2ec0dcf4e7c996e77b3f918f482664288f74f 100644 (file)
@@ -5,8 +5,14 @@ LL | fn arg_item(&_x: &String) {}
    |             ^--
    |             ||
    |             |data moved here
-   |             |help: to prevent move, use ref or ref mut: `ref _x`
    |             cannot move out of borrowed content
+   |             help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:16:14
+   |
+LL | fn arg_item(&_x: &String) {}
+   |              ^^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-move-in-irrefut-pat.rs:21:11
@@ -15,17 +21,29 @@ LL |     with(|&_x| ())
    |           ^--
    |           ||
    |           |data moved here
-   |           |help: to prevent move, use ref or ref mut: `ref _x`
    |           cannot move out of borrowed content
+   |           help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:21:12
+   |
+LL |     with(|&_x| ())
+   |            ^^
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-move-in-irrefut-pat.rs:27:15
    |
 LL |     let &_x = &"hi".to_string();
-   |          --   ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
-   |          |
-   |          data moved here
-   |          help: to prevent move, use ref or ref mut: `ref _x`
+   |         ---   ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
+   |         ||
+   |         |data moved here
+   |         help: consider removing the `&`: `_x`
+   |
+note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-in-irrefut-pat.rs:27:10
+   |
+LL |     let &_x = &"hi".to_string();
+   |          ^^
 
 error: aborting due to 3 previous errors
 
index 15c7011d71671c90b0852f028ce47060a1102c0d..34f9f035188b8d4276c21c2f5afc674365cb5f29 100644 (file)
@@ -5,10 +5,13 @@ LL |     match (S {f:"foo".to_string()}) {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
 LL |         //[mir]~^ ERROR [E0509]
 LL |         S {f:_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/borrowck-move-out-of-struct-with-dtor.rs:22:14
+   |
+LL |         S {f:_s} => {}
+   |              ^^
 
 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:28:20
@@ -17,7 +20,12 @@ LL |     let S {f:_s} = S {f:"foo".to_string()};
    |              --    ^^^^^^^^^^^^^^^^^^^^^^^ 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/borrowck-move-out-of-struct-with-dtor.rs:28:14
+   |
+LL |     let S {f:_s} = S {f:"foo".to_string()};
+   |              ^^
 
 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:19
@@ -26,8 +34,13 @@ LL | fn move_in_fn_arg(S {f:_s}: S) {
    |                   ^^^^^--^
    |                   |    |
    |                   |    data moved here
-   |                   |    help: to prevent move, use ref or ref mut: `ref _s`
    |                   cannot move out of here
+   |
+note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:24
+   |
+LL | fn move_in_fn_arg(S {f:_s}: S) {
+   |                        ^^
 
 error: aborting due to 3 previous errors
 
index 15c7011d71671c90b0852f028ce47060a1102c0d..34f9f035188b8d4276c21c2f5afc674365cb5f29 100644 (file)
@@ -5,10 +5,13 @@ LL |     match (S {f:"foo".to_string()}) {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
 LL |         //[mir]~^ ERROR [E0509]
 LL |         S {f:_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/borrowck-move-out-of-struct-with-dtor.rs:22:14
+   |
+LL |         S {f:_s} => {}
+   |              ^^
 
 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:28:20
@@ -17,7 +20,12 @@ LL |     let S {f:_s} = S {f:"foo".to_string()};
    |              --    ^^^^^^^^^^^^^^^^^^^^^^^ 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/borrowck-move-out-of-struct-with-dtor.rs:28:14
+   |
+LL |     let S {f:_s} = S {f:"foo".to_string()};
+   |              ^^
 
 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:19
@@ -26,8 +34,13 @@ LL | fn move_in_fn_arg(S {f:_s}: S) {
    |                   ^^^^^--^
    |                   |    |
    |                   |    data moved here
-   |                   |    help: to prevent move, use ref or ref mut: `ref _s`
    |                   cannot move out of here
+   |
+note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:24
+   |
+LL | fn move_in_fn_arg(S {f:_s}: S) {
+   |                        ^^
 
 error: aborting due to 3 previous errors
 
index c69ae8755a957dcdebeff4e25172412f6f622cf1..278c33c71e24549f00090137180e5a32f9df8d7d 100644 (file)
@@ -4,10 +4,13 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
 LL |     match S("foo".to_string()) {
    |           ^^^^^^^^^^^^^^^^^^^^ cannot move out of here
 LL |         S(_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/borrowck-move-out-of-tuple-struct-with-dtor.rs:18:11
+   |
+LL |         S(_s) => {}
+   |           ^^
 
 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
   --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:24:17
@@ -16,7 +19,12 @@ LL |     let S(_s) = S("foo".to_string());
    |           --    ^^^^^^^^^^^^^^^^^^^^ 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/borrowck-move-out-of-tuple-struct-with-dtor.rs:24:11
+   |
+LL |     let S(_s) = S("foo".to_string());
+   |           ^^
 
 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
   --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:28:19
@@ -25,8 +33,13 @@ LL | fn move_in_fn_arg(S(_s): S) {
    |                   ^^--^
    |                   | |
    |                   | data moved here
-   |                   | help: to prevent move, use ref or ref mut: `ref _s`
    |                   cannot move out of here
+   |
+note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:28:21
+   |
+LL | fn move_in_fn_arg(S(_s): S) {
+   |                     ^^
 
 error: aborting due to 3 previous errors
 
index 4a72d7f33026652970b485baf7aa76e090aaba8b..92e10c258c269efbd9cca6855d1dcd0e351bf573 100644 (file)
@@ -5,7 +5,7 @@ LL |     let bad = v[0];
    |               ^^^^
    |               |
    |               cannot move out of borrowed content
-   |               help: consider using a reference instead: `&v[0]`
+   |               help: consider borrowing here: `&v[0]`
 
 error: aborting due to previous error
 
index 4ba9b3aeb5d5da423591f7b3554db573cdaad917..491b5b5bd74abef53a40f7b6d0e963f9c0683bd5 100644 (file)
@@ -5,10 +5,16 @@ LL |     match &s.x {
    |           ^^^^ cannot move out of borrowed content
 LL |         &E::Foo => {}
 LL |         &E::Bar(identifier) => f(identifier.clone())  //~ ERROR cannot move
-   |                 ----------
-   |                 |
-   |                 data moved here
-   |                 help: to prevent move, use ref or ref mut: `ref identifier`
+   |         -------------------
+   |         |       |
+   |         |       data moved here
+   |         help: consider removing the `&`: `E::Bar(identifier)`
+   |
+note: move occurs because `identifier` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/by-move-pattern-binding.rs:26:17
+   |
+LL |         &E::Bar(identifier) => f(identifier.clone())  //~ ERROR cannot move
+   |                 ^^^^^^^^^^
 
 error: aborting due to previous error
 
index b265ec8bddac689c663c9d8b1d35e527f397e2c6..5522e22fb1fa28089a33a6c8851a39b7b52cf70a 100644 (file)
@@ -56,7 +56,7 @@ LL |     let y = { static x: Box<isize> = box 3; x };
    |                                             ^
    |                                             |
    |                                             cannot move out of static item
-   |                                             help: consider using a reference instead: `&x`
+   |                                             help: consider borrowing here: `&x`
 
 error[E0010]: allocations are not allowed in statics
   --> $DIR/check-static-values-constraints.rs:120:38
index a8be048d7df6c25c5e0e2c8551704e01d546f7a4..8e0599370287fb886ef239e8b593c5088c94d7dd 100644 (file)
@@ -5,7 +5,12 @@ LL |     let X { x: y } = x; //~ ERROR cannot move out of type
    |                -     ^ cannot move out of here
    |                |
    |                data moved here
-   |                help: to prevent move, use ref or ref mut: `ref y`
+   |
+note: move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/disallowed-deconstructing-destructing-struct-let.rs:22:16
+   |
+LL |     let X { x: y } = x; //~ ERROR cannot move out of type
+   |                ^
 
 error: aborting due to previous error
 
index 9f0d2d5f0e1891e42d588a51db7c0b663dd22428..dd1a3ef2a2b9835c1403c0796b7475cb4b7de57d 100644 (file)
@@ -4,10 +4,13 @@ error[E0509]: cannot move out of type `X`, which implements the `Drop` trait
 LL |     match x {
    |           ^ cannot move out of here
 LL |         X { x: y } => println!("contents: {}", y)
-   |                -
-   |                |
-   |                data moved here
-   |                help: to prevent move, use ref or ref mut: `ref y`
+   |                - data moved here
+   |
+note: move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait
+  --> $DIR/disallowed-deconstructing-destructing-struct-match.rs:25:16
+   |
+LL |         X { x: y } => println!("contents: {}", y)
+   |                ^
 
 error: aborting due to previous error
 
index b061b6a7963859daed322b322498da6a7c3dd45c..aa62b457ecdf378cef6c96e4a6256aa36293a886 100644 (file)
@@ -4,10 +4,13 @@ error[E0508]: cannot move out of type `[A]`, a non-copy slice
 LL |     match a {
    |           ^ cannot move out of here
 LL |         box [a] => {}, //~ ERROR cannot move out of type `[A]`, a non-copy slice
-   |              -
-   |              |
-   |              data moved here
-   |              help: to prevent move, use ref or ref mut: `ref a`
+   |              - data moved here
+   |
+note: move occurs because `a` has type `A`, which does not implement the `Copy` trait
+  --> $DIR/move-out-of-slice-1.rs:18:14
+   |
+LL |         box [a] => {}, //~ ERROR cannot move out of type `[A]`, a non-copy slice
+   |              ^
 
 error: aborting due to previous error