提交 9a0020a8 编写于 作者: A ashtneoi

Bless UI tests

上级 d6dbdee7
...@@ -5,14 +5,24 @@ LL | match *f { //~ ERROR cannot move out of ...@@ -5,14 +5,24 @@ LL | match *f { //~ ERROR cannot move out of
| ^^ | ^^
| | | |
| cannot move out of borrowed content | cannot move out of borrowed content
| help: consider removing this dereference operator: `f` | help: consider removing the `*`: `f`
LL | //~| cannot move out LL | //~| cannot move out
LL | Foo::Foo1(num1, 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) => (), 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) => (), 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 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
--> $DIR/borrowck-move-error-with-note.rs:39:11 --> $DIR/borrowck-move-error-with-note.rs:39:11
...@@ -23,12 +33,15 @@ LL | match (S {f: "foo".to_string(), g: "bar".to_string()}) { ...@@ -23,12 +33,15 @@ LL | match (S {f: "foo".to_string(), g: "bar".to_string()}) {
LL | f: _s, LL | f: _s,
| -- data moved here | -- data moved here
LL | g: _t LL | g: _t
| -- ... and here | -- ...and here
help: to prevent move, use ref or ref mut
| |
LL | f: ref _s, note: move occurs because these variables have types that don't implement the `Copy` trait
LL | g: ref _t --> $DIR/borrowck-move-error-with-note.rs:42:16
| |
LL | f: _s,
| ^^
LL | g: _t
| ^^
error[E0507]: cannot move out of borrowed content error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-move-error-with-note.rs:57:11 --> $DIR/borrowck-move-error-with-note.rs:57:11
...@@ -37,10 +50,16 @@ LL | match a.a { //~ ERROR cannot move out of ...@@ -37,10 +50,16 @@ LL | match a.a { //~ ERROR cannot move out of
| ^^^ | ^^^
| | | |
| cannot move out of borrowed content | 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 | //~| cannot move out
LL | n => { 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 error: aborting due to 3 previous errors
......
...@@ -7,14 +7,23 @@ LL | &[Foo { string: a }, ...@@ -7,14 +7,23 @@ LL | &[Foo { string: a },
| - data moved here | - data moved here
... ...
LL | Foo { string: b }] => { LL | Foo { string: b }] => {
| - ... and here | - ...and here
help: to prevent move, use ref or ref mut
| |
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 | //~^ ERROR cannot move out of type `[Foo]`
LL | //~| cannot move out LL | //~| cannot move out
LL | //~| to prevent move LL | //~| to prevent move
LL | Foo { string: ref b }] => { LL | Foo { string: b }] => {
| |
error: aborting due to previous error error: aborting due to previous error
......
...@@ -28,10 +28,21 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli ...@@ -28,10 +28,21 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
LL | match vec { LL | match vec {
| ^^^ cannot move out of here | ^^^ cannot move out of here
LL | &mut [_a, //~ ERROR cannot move out LL | &mut [_a, //~ ERROR cannot move out
| -- | -- data moved here
| | |
| data moved here note: move occurs because `_a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
| help: to prevent move, use ref or ref mut: `ref _a` --> $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 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:57:13 --> $DIR/borrowck-vec-pattern-nesting.rs:57:13
...@@ -40,7 +51,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out ...@@ -40,7 +51,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^ | ^^^^^^
| | | |
| cannot move out of here | 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 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:64:11 --> $DIR/borrowck-vec-pattern-nesting.rs:64:11
...@@ -49,10 +60,19 @@ LL | match vec { ...@@ -49,10 +60,19 @@ LL | match vec {
| ^^^ cannot move out of here | ^^^ cannot move out of here
... ...
LL | _b] => {} LL | _b] => {}
| -- | -- data moved here
| | |
| data moved here note: move occurs because `_b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
| help: to prevent move, use ref or ref mut: `ref _b` --> $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 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:70:13 --> $DIR/borrowck-vec-pattern-nesting.rs:70:13
...@@ -61,7 +81,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out ...@@ -61,7 +81,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^ | ^^^^^^
| | | |
| cannot move out of here | 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 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:77:11 --> $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 ...@@ -69,14 +89,18 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
LL | match vec { LL | match vec {
| ^^^ cannot move out of here | ^^^ cannot move out of here
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
| -- -- -- ... and here | -----------------
| | | | | | | |
| | ... and here | | | | ...and here
| data moved here | | | ...and here
help: to prevent move, use ref or ref mut | | data moved here
| | help: consider removing the `&mut`: `[_a, _b, _c]`
LL | &mut [ref _a, ref _b, ref _c] => {} //~ ERROR cannot move out |
| ^^^^^^ ^^^^^^ ^^^^^^ 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 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:82:13 --> $DIR/borrowck-vec-pattern-nesting.rs:82:13
...@@ -85,7 +109,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out ...@@ -85,7 +109,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^ | ^^^^^^
| | | |
| cannot move out of here | 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 error: aborting due to 8 previous errors
......
...@@ -5,8 +5,13 @@ LL | let opt = a.iter().enumerate().find(|(_, &s)| { ...@@ -5,8 +5,13 @@ LL | let opt = a.iter().enumerate().find(|(_, &s)| {
| ^^^^^-^ | ^^^^^-^
| | | | | |
| | data moved here | | data moved here
| | help: to prevent move, use ref or ref mut: `ref s`
| cannot move out of borrowed content | 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 error: aborting due to previous error
......
...@@ -4,10 +4,13 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait ...@@ -4,10 +4,13 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
LL | match (S {f:"foo".to_string()}) { LL | match (S {f:"foo".to_string()}) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
LL | S {f:_s} => {} //~ ERROR cannot move out LL | S {f:_s} => {} //~ ERROR cannot move out
| -- | -- data moved here
| | |
| data moved here note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
| help: to prevent move, use ref or ref mut: `ref _s` --> $DIR/overlapping_spans.rs:21:14
|
LL | S {f:_s} => {} //~ ERROR cannot move out
| ^^
error: aborting due to previous error error: aborting due to previous error
......
...@@ -8,15 +8,16 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[]) ...@@ -8,15 +8,16 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
| -- data moved here | -- data moved here
... ...
LL | (&[hd1, ..], &[hd2, ..]) LL | (&[hd1, ..], &[hd2, ..])
| --- ... and here | --- ...and here
help: to prevent move, use ref or ref mut
| |
LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[]) note: move occurs because these variables have types that don't implement the `Copy` trait
LL | => println!("one empty"), --> $DIR/issue-12567.rs:16:17
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, ..])
| |
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
| ^^
...
LL | (&[hd1, ..], &[hd2, ..])
| ^^^
error[E0508]: cannot move out of type `[T]`, a non-copy slice error[E0508]: cannot move out of type `[T]`, a non-copy slice
--> $DIR/issue-12567.rs:14:11 --> $DIR/issue-12567.rs:14:11
...@@ -28,15 +29,16 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[]) ...@@ -28,15 +29,16 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
| -- data moved here | -- data moved here
... ...
LL | (&[hd1, ..], &[hd2, ..]) LL | (&[hd1, ..], &[hd2, ..])
| --- ... and here | --- ...and here
help: to prevent move, use ref or ref mut
| |
LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[]) note: move occurs because these variables have types that don't implement the `Copy` trait
LL | => println!("one empty"), --> $DIR/issue-12567.rs:16:17
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, ..])
| |
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
| ^^
...
LL | (&[hd1, ..], &[hd2, ..])
| ^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors
......
...@@ -5,7 +5,7 @@ LL | let a = unsafe { *mut_ref() }; ...@@ -5,7 +5,7 @@ LL | let a = unsafe { *mut_ref() };
| ^^^^^^^^^^ | ^^^^^^^^^^
| | | |
| cannot move out of borrowed content | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/issue-20801.rs:39:22 --> $DIR/issue-20801.rs:39:22
...@@ -14,7 +14,7 @@ LL | let b = unsafe { *imm_ref() }; ...@@ -14,7 +14,7 @@ LL | let b = unsafe { *imm_ref() };
| ^^^^^^^^^^ | ^^^^^^^^^^
| | | |
| cannot move out of borrowed content | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/issue-20801.rs:42:22 --> $DIR/issue-20801.rs:42:22
...@@ -23,7 +23,7 @@ LL | let c = unsafe { *mut_ptr() }; ...@@ -23,7 +23,7 @@ LL | let c = unsafe { *mut_ptr() };
| ^^^^^^^^^^ | ^^^^^^^^^^
| | | |
| cannot move out of borrowed content | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/issue-20801.rs:45:22 --> $DIR/issue-20801.rs:45:22
...@@ -32,7 +32,7 @@ LL | let d = unsafe { *const_ptr() }; ...@@ -32,7 +32,7 @@ LL | let d = unsafe { *const_ptr() };
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| | | |
| cannot move out of borrowed content | 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 error: aborting due to 4 previous errors
......
...@@ -5,7 +5,7 @@ LL | let e = f.v[0]; //~ ERROR cannot move out of indexed content ...@@ -5,7 +5,7 @@ LL | let e = f.v[0]; //~ ERROR cannot move out of indexed content
| ^^^^^^ | ^^^^^^
| | | |
| cannot move out of borrowed 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 error: aborting due to previous error
......
...@@ -5,9 +5,15 @@ LL | let (a, b) = x[0]; //~ ERROR cannot move out of indexed content ...@@ -5,9 +5,15 @@ LL | let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
| - - ^^^^ | - - ^^^^
| | | | | | | |
| | | cannot move out of borrowed content | | | cannot move out of borrowed content
| | | help: consider using a reference instead: `&x[0]` | | | help: consider borrowing here: `&x[0]`
| | move occurs because b has type `std::string::String`, which does not implement the `Copy` trait | | ...and here
| move occurs because a has type `std::string::String`, which does not implement the `Copy` trait | 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 error: aborting due to previous error
......
...@@ -5,10 +5,16 @@ LL | match hellothere.x { //~ ERROR cannot move out ...@@ -5,10 +5,16 @@ LL | match hellothere.x { //~ ERROR cannot move out
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| | | |
| cannot move out of borrowed content | 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()), 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 error: aborting due to previous error
......
...@@ -5,7 +5,7 @@ LL | let x = { *r }; //~ ERROR ...@@ -5,7 +5,7 @@ LL | let x = { *r }; //~ ERROR
| ^^ | ^^
| | | |
| cannot move out of borrowed content | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:16:22 --> $DIR/cannot-move-block-spans.rs:16:22
...@@ -14,7 +14,7 @@ LL | let y = unsafe { *r }; //~ ERROR ...@@ -14,7 +14,7 @@ LL | let y = unsafe { *r }; //~ ERROR
| ^^ | ^^
| | | |
| cannot move out of borrowed content | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:17:26 --> $DIR/cannot-move-block-spans.rs:17:26
...@@ -23,7 +23,7 @@ LL | let z = loop { break *r; }; //~ ERROR ...@@ -23,7 +23,7 @@ LL | let z = loop { break *r; }; //~ ERROR
| ^^ | ^^
| | | |
| cannot move out of borrowed content | 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 error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
--> $DIR/cannot-move-block-spans.rs:21:15 --> $DIR/cannot-move-block-spans.rs:21:15
...@@ -32,7 +32,7 @@ LL | let x = { arr[0] }; //~ ERROR ...@@ -32,7 +32,7 @@ LL | let x = { arr[0] }; //~ ERROR
| ^^^^^^ | ^^^^^^
| | | |
| cannot move out of here | 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 error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
--> $DIR/cannot-move-block-spans.rs:22:22 --> $DIR/cannot-move-block-spans.rs:22:22
...@@ -41,7 +41,7 @@ LL | let y = unsafe { arr[0] }; //~ ERROR ...@@ -41,7 +41,7 @@ LL | let y = unsafe { arr[0] }; //~ ERROR
| ^^^^^^ | ^^^^^^
| | | |
| cannot move out of here | 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 error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
--> $DIR/cannot-move-block-spans.rs:23:26 --> $DIR/cannot-move-block-spans.rs:23:26
...@@ -50,7 +50,7 @@ LL | let z = loop { break arr[0]; }; //~ ERROR ...@@ -50,7 +50,7 @@ LL | let z = loop { break arr[0]; }; //~ ERROR
| ^^^^^^ | ^^^^^^
| | | |
| cannot move out of here | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:27:38 --> $DIR/cannot-move-block-spans.rs:27:38
...@@ -59,7 +59,7 @@ LL | let x = { let mut u = 0; u += 1; *r }; //~ ERROR ...@@ -59,7 +59,7 @@ LL | let x = { let mut u = 0; u += 1; *r }; //~ ERROR
| ^^ | ^^
| | | |
| cannot move out of borrowed content | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:28:45 --> $DIR/cannot-move-block-spans.rs:28:45
...@@ -68,7 +68,7 @@ LL | let y = unsafe { let mut u = 0; u += 1; *r }; //~ ERROR ...@@ -68,7 +68,7 @@ LL | let y = unsafe { let mut u = 0; u += 1; *r }; //~ ERROR
| ^^ | ^^
| | | |
| cannot move out of borrowed content | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/cannot-move-block-spans.rs:29:49 --> $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 ...@@ -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 | 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 error: aborting due to 9 previous errors
......
...@@ -5,7 +5,7 @@ LL | let b = *a; ...@@ -5,7 +5,7 @@ LL | let b = *a;
| ^^ | ^^
| | | |
| cannot move out of borrowed content | 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 error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
--> $DIR/move-errors.rs:25:13 --> $DIR/move-errors.rs:25:13
...@@ -14,7 +14,7 @@ LL | let b = a[0]; ...@@ -14,7 +14,7 @@ LL | let b = a[0];
| ^^^^ | ^^^^
| | | |
| cannot move out of here | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:32:13 --> $DIR/move-errors.rs:32:13
...@@ -23,7 +23,7 @@ LL | let s = **r; ...@@ -23,7 +23,7 @@ LL | let s = **r;
| ^^^ | ^^^
| | | |
| cannot move out of borrowed content | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:40:13 --> $DIR/move-errors.rs:40:13
...@@ -32,7 +32,7 @@ LL | let s = *r; ...@@ -32,7 +32,7 @@ LL | let s = *r;
| ^^ | ^^
| | | |
| cannot move out of borrowed content | 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 error[E0508]: cannot move out of type `[A; 1]`, a non-copy array
--> $DIR/move-errors.rs:45:13 --> $DIR/move-errors.rs:45:13
...@@ -41,7 +41,7 @@ LL | let a = [A("".to_string())][0]; ...@@ -41,7 +41,7 @@ LL | let a = [A("".to_string())][0];
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
| | | |
| cannot move out of here | 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 error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:51:16 --> $DIR/move-errors.rs:51:16
...@@ -50,8 +50,14 @@ LL | let A(s) = *a; ...@@ -50,8 +50,14 @@ LL | let A(s) = *a;
| - ^^ | - ^^
| | | | | |
| | cannot move out of borrowed content | | cannot move out of borrowed content
| | help: consider removing this dereference operator: `a` | | help: consider removing the `*`: `a`
| 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:51:11
|
LL | let A(s) = *a;
| ^
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
--> $DIR/move-errors.rs:57:19 --> $DIR/move-errors.rs:57:19
...@@ -60,7 +66,12 @@ LL | let C(D(s)) = c; ...@@ -60,7 +66,12 @@ LL | let C(D(s)) = c;
| - ^ cannot move out of here | - ^ cannot move out of here
| | | |
| data moved 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 error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:64:9 --> $DIR/move-errors.rs:64:9
...@@ -75,12 +86,20 @@ LL | match x[0] { ...@@ -75,12 +86,20 @@ LL | match x[0] {
| ^^^^ | ^^^^
| | | |
| cannot move out of here | cannot move out of here
| help: consider using a reference instead: `&x[0]` | help: consider borrowing here: `&x[0]`
LL | //~^ ERROR LL | //~^ ERROR
LL | B::U(d) => (), 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) => (), 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 error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
--> $DIR/move-errors.rs:96:11 --> $DIR/move-errors.rs:96:11
...@@ -89,10 +108,13 @@ LL | match x { ...@@ -89,10 +108,13 @@ LL | match x {
| ^ cannot move out of here | ^ cannot move out of here
... ...
LL | B::U(D(s)) => (), LL | B::U(D(s)) => (),
| - | - data moved here
| | |
| data moved here note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
| help: to prevent move, use ref or ref mut: `ref s` --> $DIR/move-errors.rs:99:16
|
LL | B::U(D(s)) => (),
| ^
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
--> $DIR/move-errors.rs:105:11 --> $DIR/move-errors.rs:105:11
...@@ -101,10 +123,13 @@ LL | match x { ...@@ -101,10 +123,13 @@ LL | match x {
| ^ cannot move out of here | ^ cannot move out of here
... ...
LL | (D(s), &t) => (), LL | (D(s), &t) => (),
| - | - data moved here
| | |
| data moved here note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
| help: to prevent move, use ref or ref mut: `ref s` --> $DIR/move-errors.rs:108:12
|
LL | (D(s), &t) => (),
| ^
error[E0507]: cannot move out of borrowed content error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:105:11 --> $DIR/move-errors.rs:105:11
...@@ -113,10 +138,13 @@ LL | match x { ...@@ -113,10 +138,13 @@ LL | match x {
| ^ cannot move out of borrowed content | ^ cannot move out of borrowed content
... ...
LL | (D(s), &t) => (), LL | (D(s), &t) => (),
| - | - data moved here
| | |
| data moved here note: move occurs because `t` has type `std::string::String`, which does not implement the `Copy` trait
| help: to prevent move, use ref or ref mut: `ref t` --> $DIR/move-errors.rs:108:17
|
LL | (D(s), &t) => (),
| ^
error[E0509]: cannot move out of type `F`, which implements the `Drop` trait error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
--> $DIR/move-errors.rs:115:11 --> $DIR/move-errors.rs:115:11
...@@ -125,13 +153,15 @@ LL | match x { ...@@ -125,13 +153,15 @@ LL | match x {
| ^ cannot move out of here | ^ cannot move out of here
LL | //~^ ERROR LL | //~^ ERROR
LL | F(s, mut t) => (), LL | F(s, mut t) => (),
| - ----- ... and here | - ----- ...and here
| | | |
| data moved 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 error[E0507]: cannot move out of borrowed content
--> $DIR/move-errors.rs:123:11 --> $DIR/move-errors.rs:123:11
...@@ -140,10 +170,16 @@ LL | match *x { ...@@ -140,10 +170,16 @@ LL | match *x {
| ^^ | ^^
| | | |
| cannot move out of borrowed content | cannot move out of borrowed content
| help: consider removing this dereference operator: `x` | help: consider removing the `*`: `x`
LL | //~^ ERROR LL | //~^ ERROR
LL | Ok(s) | Err(s) => (), 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 error: aborting due to 14 previous errors
......
...@@ -524,7 +524,7 @@ LL | &mut Either::One(_t) => (), ...@@ -524,7 +524,7 @@ LL | &mut Either::One(_t) => (),
| -- data moved here | -- data moved here
... ...
LL | &mut Either::Two(_t) => (), LL | &mut Either::Two(_t) => (),
| -- ... and here | -- ...and here
| |
note: move occurs because these variables have types that don't implement the `Copy` trait note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/dont-suggest-ref.rs:233:26 --> $DIR/dont-suggest-ref.rs:233:26
...@@ -705,7 +705,7 @@ LL | //~^ ERROR cannot move ...@@ -705,7 +705,7 @@ LL | //~^ ERROR cannot move
LL | (&mut Either::One(_t),) => (), LL | (&mut Either::One(_t),) => (),
| -- data moved here | -- data moved here
LL | (&mut Either::Two(_t),) => (), LL | (&mut Either::Two(_t),) => (),
| -- ... and here | -- ...and here
| |
note: move occurs because these variables have types that don't implement the `Copy` trait note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/dont-suggest-ref.rs:290:27 --> $DIR/dont-suggest-ref.rs:290:27
...@@ -937,7 +937,7 @@ error[E0507]: cannot move out of borrowed content ...@@ -937,7 +937,7 @@ error[E0507]: cannot move out of borrowed content
LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone());
| --------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content | --------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&`: `(X(_t), X(_u))` | help: consider removing the `&`: `(X(_t), X(_u))`
| |
...@@ -953,7 +953,7 @@ error[E0507]: cannot move out of borrowed content ...@@ -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()) { } LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { }
| ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content | ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -969,7 +969,7 @@ error[E0507]: cannot move out of borrowed content ...@@ -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()) { } LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { }
| ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content | ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -986,12 +986,12 @@ LL | match &(e.clone(), e.clone()) { ...@@ -986,12 +986,12 @@ LL | match &(e.clone(), e.clone()) {
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
LL | //~^ ERROR cannot move LL | //~^ ERROR cannot move
LL | &(Either::One(_t), Either::Two(_u)) => (), LL | &(Either::One(_t), Either::Two(_u)) => (),
| -- -- ... and here | -- -- ...and here
| | | |
| data moved here | data moved here
... ...
LL | &(Either::Two(_t), Either::One(_u)) => (), 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 note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/dont-suggest-ref.rs:391:23 --> $DIR/dont-suggest-ref.rs:391:23
...@@ -1019,7 +1019,7 @@ LL | //~^ ERROR cannot move ...@@ -1019,7 +1019,7 @@ LL | //~^ ERROR cannot move
LL | &(Either::One(_t), Either::Two(_u)) LL | &(Either::One(_t), Either::Two(_u))
| ----------------------------------- | -----------------------------------
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1038,7 +1038,7 @@ LL | //~^ ERROR cannot move ...@@ -1038,7 +1038,7 @@ LL | //~^ ERROR cannot move
LL | &(Either::One(_t), Either::Two(_u)) => (), LL | &(Either::One(_t), Either::Two(_u)) => (),
| ----------------------------------- | -----------------------------------
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1057,7 +1057,7 @@ LL | //~^ ERROR cannot move ...@@ -1057,7 +1057,7 @@ LL | //~^ ERROR cannot move
LL | &(Either::One(_t), Either::Two(_u)) => (), LL | &(Either::One(_t), Either::Two(_u)) => (),
| ----------------------------------- | -----------------------------------
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1073,7 +1073,7 @@ error[E0507]: cannot move out of borrowed content ...@@ -1073,7 +1073,7 @@ error[E0507]: cannot move out of borrowed content
LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone());
| ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&mut`: `(X(_t), X(_u))` | help: consider removing the `&mut`: `(X(_t), X(_u))`
| |
...@@ -1089,7 +1089,7 @@ error[E0507]: cannot move out of borrowed content ...@@ -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()) { } LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { }
| --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content | --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1105,7 +1105,7 @@ error[E0507]: cannot move out of borrowed content ...@@ -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()) { } LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { }
| --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content | --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1122,12 +1122,12 @@ LL | match &mut (em.clone(), em.clone()) { ...@@ -1122,12 +1122,12 @@ LL | match &mut (em.clone(), em.clone()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
LL | //~^ ERROR cannot move LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) => (), LL | &mut (Either::One(_t), Either::Two(_u)) => (),
| -- -- ... and here | -- -- ...and here
| | | |
| data moved here | data moved here
... ...
LL | &mut (Either::Two(_t), Either::One(_u)) => (), 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 note: move occurs because these variables have types that don't implement the `Copy` trait
--> $DIR/dont-suggest-ref.rs:443:27 --> $DIR/dont-suggest-ref.rs:443:27
...@@ -1155,7 +1155,7 @@ LL | //~^ ERROR cannot move ...@@ -1155,7 +1155,7 @@ LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) LL | &mut (Either::One(_t), Either::Two(_u))
| --------------------------------------- | ---------------------------------------
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1174,7 +1174,7 @@ LL | //~^ ERROR cannot move ...@@ -1174,7 +1174,7 @@ LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) => (), LL | &mut (Either::One(_t), Either::Two(_u)) => (),
| --------------------------------------- | ---------------------------------------
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1193,7 +1193,7 @@ LL | //~^ ERROR cannot move ...@@ -1193,7 +1193,7 @@ LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) => (), LL | &mut (Either::One(_t), Either::Two(_u)) => (),
| --------------------------------------- | ---------------------------------------
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1212,7 +1212,7 @@ LL | //~^ ERROR cannot move ...@@ -1212,7 +1212,7 @@ LL | //~^ ERROR cannot move
LL | &mut (Either::One(_t), Either::Two(_u)) => (), LL | &mut (Either::One(_t), Either::Two(_u)) => (),
| --------------------------------------- | ---------------------------------------
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
| |
...@@ -1290,7 +1290,7 @@ error[E0507]: cannot move out of borrowed content ...@@ -1290,7 +1290,7 @@ error[E0507]: cannot move out of borrowed content
LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } LL | fn f5(&(X(_t), X(_u)): &(X, X)) { }
| ^^^^--^^^^^--^^ | ^^^^--^^^^^--^^
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| cannot move out of borrowed content | cannot move out of borrowed content
| help: consider removing the `&`: `(X(_t), X(_u))` | help: consider removing the `&`: `(X(_t), X(_u))`
...@@ -1307,7 +1307,7 @@ error[E0507]: cannot move out of borrowed content ...@@ -1307,7 +1307,7 @@ error[E0507]: cannot move out of borrowed content
LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { }
| ^^^^^^^^--^^^^^--^^ | ^^^^^^^^--^^^^^--^^
| | | | | | | |
| | | ... and here | | | ...and here
| | data moved here | | data moved here
| cannot move out of borrowed content | cannot move out of borrowed content
| help: consider removing the `&mut`: `(X(_t), X(_u))` | help: consider removing the `&mut`: `(X(_t), X(_u))`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册