mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Bless tests
This commit is contained in:
parent
a5b008c450
commit
bd2b54c23c
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user