Skip to content

Commit bd2b54c

Browse files
committed
Bless tests
1 parent a5b008c commit bd2b54c

16 files changed

+178
-62
lines changed

src/test/ui/E0508-fail.mir.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let _value = array[0]; //[ast]~ ERROR [E0508]
55
| ^^^^^^^^
66
| |
77
| cannot move out of here
8-
| help: consider using a reference instead: `&array[0]`
8+
| help: consider borrowing here: `&array[0]`
99

1010
error: aborting due to previous error
1111

src/test/ui/access-mode-in-closures.nll.stderr

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ error[E0507]: cannot move out of borrowed content
22
--> $DIR/access-mode-in-closures.rs:19:15
33
|
44
LL | match *s { sty(v) => v } //~ ERROR cannot move out
5-
| ^^ - move occurs because v has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
5+
| ^^ - data moved here
66
| |
77
| cannot move out of borrowed content
8-
| help: consider removing this dereference operator: `s`
8+
| help: consider removing the `*`: `s`
9+
|
10+
note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
11+
--> $DIR/access-mode-in-closures.rs:19:24
12+
|
13+
LL | match *s { sty(v) => v } //~ ERROR cannot move out
14+
| ^
915

1016
error: aborting due to previous error
1117

src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.nll.stderr

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,46 @@ error[E0507]: cannot move out of borrowed content
22
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:15
33
|
44
LL | for &a in x.iter() { //~ ERROR cannot move out
5-
| - ^^^^^^^^ cannot move out of borrowed content
6-
| |
7-
| data moved here
8-
| help: to prevent move, use ref or ref mut: `ref a`
5+
| -- ^^^^^^^^ cannot move out of borrowed content
6+
| ||
7+
| |data moved here
8+
| help: consider removing the `&`: `a`
9+
|
10+
note: move occurs because `a` has type `&mut i32`, which does not implement the `Copy` trait
11+
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:10
12+
|
13+
LL | for &a in x.iter() { //~ ERROR cannot move out
14+
| ^
915

1016
error[E0507]: cannot move out of borrowed content
1117
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:15
1218
|
1319
LL | for &a in &f.a { //~ ERROR cannot move out
14-
| - ^^^^ cannot move out of borrowed content
15-
| |
16-
| data moved here
17-
| help: to prevent move, use ref or ref mut: `ref a`
20+
| -- ^^^^ cannot move out of borrowed content
21+
| ||
22+
| |data moved here
23+
| help: consider removing the `&`: `a`
24+
|
25+
note: move occurs because `a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
26+
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:10
27+
|
28+
LL | for &a in &f.a { //~ ERROR cannot move out
29+
| ^
1830

1931
error[E0507]: cannot move out of borrowed content
2032
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:15
2133
|
2234
LL | for &a in x.iter() { //~ ERROR cannot move out
23-
| - ^^^^^^^^ cannot move out of borrowed content
24-
| |
25-
| data moved here
26-
| help: to prevent move, use ref or ref mut: `ref a`
35+
| -- ^^^^^^^^ cannot move out of borrowed content
36+
| ||
37+
| |data moved here
38+
| help: consider removing the `&`: `a`
39+
|
40+
note: move occurs because `a` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
41+
--> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:10
42+
|
43+
LL | for &a in x.iter() { //~ ERROR cannot move out
44+
| ^
2745

2846
error: aborting due to 3 previous errors
2947

src/test/ui/borrowck/borrowck-issue-2657-2.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let _b = *y; //~ ERROR cannot move out
55
| ^^
66
| |
77
| cannot move out of borrowed content
8-
| help: consider removing this dereference operator: `y`
8+
| help: consider removing the `*`: `y`
99

1010
error: aborting due to previous error
1111

src/test/ui/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let y = *x; //~ ERROR cannot move out of dereference of raw pointer
55
| ^^
66
| |
77
| cannot move out of borrowed content
8-
| help: consider using a reference instead: `&*x`
8+
| help: consider removing the `*`: `x`
99

1010
error: aborting due to previous error
1111

src/test/ui/borrowck/borrowck-move-in-irrefut-pat.ast.nll.stderr

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ LL | fn arg_item(&_x: &String) {}
55
| ^--
66
| ||
77
| |data moved here
8-
| |help: to prevent move, use ref or ref mut: `ref _x`
98
| cannot move out of borrowed content
9+
| help: consider removing the `&`: `_x`
10+
|
11+
note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
12+
--> $DIR/borrowck-move-in-irrefut-pat.rs:16:14
13+
|
14+
LL | fn arg_item(&_x: &String) {}
15+
| ^^
1016

1117
error[E0507]: cannot move out of borrowed content
1218
--> $DIR/borrowck-move-in-irrefut-pat.rs:21:11
@@ -15,17 +21,29 @@ LL | with(|&_x| ())
1521
| ^--
1622
| ||
1723
| |data moved here
18-
| |help: to prevent move, use ref or ref mut: `ref _x`
1924
| cannot move out of borrowed content
25+
| help: consider removing the `&`: `_x`
26+
|
27+
note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
28+
--> $DIR/borrowck-move-in-irrefut-pat.rs:21:12
29+
|
30+
LL | with(|&_x| ())
31+
| ^^
2032

2133
error[E0507]: cannot move out of borrowed content
2234
--> $DIR/borrowck-move-in-irrefut-pat.rs:27:15
2335
|
2436
LL | let &_x = &"hi".to_string();
25-
| -- ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
26-
| |
27-
| data moved here
28-
| help: to prevent move, use ref or ref mut: `ref _x`
37+
| --- ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
38+
| ||
39+
| |data moved here
40+
| help: consider removing the `&`: `_x`
41+
|
42+
note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
43+
--> $DIR/borrowck-move-in-irrefut-pat.rs:27:10
44+
|
45+
LL | let &_x = &"hi".to_string();
46+
| ^^
2947

3048
error: aborting due to 3 previous errors
3149

src/test/ui/borrowck/borrowck-move-in-irrefut-pat.mir.stderr

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ LL | fn arg_item(&_x: &String) {}
55
| ^--
66
| ||
77
| |data moved here
8-
| |help: to prevent move, use ref or ref mut: `ref _x`
98
| cannot move out of borrowed content
9+
| help: consider removing the `&`: `_x`
10+
|
11+
note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
12+
--> $DIR/borrowck-move-in-irrefut-pat.rs:16:14
13+
|
14+
LL | fn arg_item(&_x: &String) {}
15+
| ^^
1016

1117
error[E0507]: cannot move out of borrowed content
1218
--> $DIR/borrowck-move-in-irrefut-pat.rs:21:11
@@ -15,17 +21,29 @@ LL | with(|&_x| ())
1521
| ^--
1622
| ||
1723
| |data moved here
18-
| |help: to prevent move, use ref or ref mut: `ref _x`
1924
| cannot move out of borrowed content
25+
| help: consider removing the `&`: `_x`
26+
|
27+
note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
28+
--> $DIR/borrowck-move-in-irrefut-pat.rs:21:12
29+
|
30+
LL | with(|&_x| ())
31+
| ^^
2032

2133
error[E0507]: cannot move out of borrowed content
2234
--> $DIR/borrowck-move-in-irrefut-pat.rs:27:15
2335
|
2436
LL | let &_x = &"hi".to_string();
25-
| -- ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
26-
| |
27-
| data moved here
28-
| help: to prevent move, use ref or ref mut: `ref _x`
37+
| --- ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content
38+
| ||
39+
| |data moved here
40+
| help: consider removing the `&`: `_x`
41+
|
42+
note: move occurs because `_x` has type `std::string::String`, which does not implement the `Copy` trait
43+
--> $DIR/borrowck-move-in-irrefut-pat.rs:27:10
44+
|
45+
LL | let &_x = &"hi".to_string();
46+
| ^^
2947

3048
error: aborting due to 3 previous errors
3149

src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ LL | match (S {f:"foo".to_string()}) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
66
LL | //[mir]~^ ERROR [E0509]
77
LL | S {f:_s} => {}
8-
| --
9-
| |
10-
| data moved here
11-
| help: to prevent move, use ref or ref mut: `ref _s`
8+
| -- data moved here
9+
|
10+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
11+
--> $DIR/borrowck-move-out-of-struct-with-dtor.rs:22:14
12+
|
13+
LL | S {f:_s} => {}
14+
| ^^
1215

1316
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
1417
--> $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()};
1720
| -- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
1821
| |
1922
| data moved here
20-
| help: to prevent move, use ref or ref mut: `ref _s`
23+
|
24+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
25+
--> $DIR/borrowck-move-out-of-struct-with-dtor.rs:28:14
26+
|
27+
LL | let S {f:_s} = S {f:"foo".to_string()};
28+
| ^^
2129

2230
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
2331
--> $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) {
2634
| ^^^^^--^
2735
| | |
2836
| | data moved here
29-
| | help: to prevent move, use ref or ref mut: `ref _s`
3037
| cannot move out of here
38+
|
39+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
40+
--> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:24
41+
|
42+
LL | fn move_in_fn_arg(S {f:_s}: S) {
43+
| ^^
3144

3245
error: aborting due to 3 previous errors
3346

src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ LL | match (S {f:"foo".to_string()}) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
66
LL | //[mir]~^ ERROR [E0509]
77
LL | S {f:_s} => {}
8-
| --
9-
| |
10-
| data moved here
11-
| help: to prevent move, use ref or ref mut: `ref _s`
8+
| -- data moved here
9+
|
10+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
11+
--> $DIR/borrowck-move-out-of-struct-with-dtor.rs:22:14
12+
|
13+
LL | S {f:_s} => {}
14+
| ^^
1215

1316
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
1417
--> $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()};
1720
| -- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
1821
| |
1922
| data moved here
20-
| help: to prevent move, use ref or ref mut: `ref _s`
23+
|
24+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
25+
--> $DIR/borrowck-move-out-of-struct-with-dtor.rs:28:14
26+
|
27+
LL | let S {f:_s} = S {f:"foo".to_string()};
28+
| ^^
2129

2230
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
2331
--> $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) {
2634
| ^^^^^--^
2735
| | |
2836
| | data moved here
29-
| | help: to prevent move, use ref or ref mut: `ref _s`
3037
| cannot move out of here
38+
|
39+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
40+
--> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:24
41+
|
42+
LL | fn move_in_fn_arg(S {f:_s}: S) {
43+
| ^^
3144

3245
error: aborting due to 3 previous errors
3346

src/test/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.nll.stderr

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
44
LL | match S("foo".to_string()) {
55
| ^^^^^^^^^^^^^^^^^^^^ cannot move out of here
66
LL | S(_s) => {}
7-
| --
8-
| |
9-
| data moved here
10-
| help: to prevent move, use ref or ref mut: `ref _s`
7+
| -- data moved here
8+
|
9+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
10+
--> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:18:11
11+
|
12+
LL | S(_s) => {}
13+
| ^^
1114

1215
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
1316
--> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:24:17
@@ -16,7 +19,12 @@ LL | let S(_s) = S("foo".to_string());
1619
| -- ^^^^^^^^^^^^^^^^^^^^ cannot move out of here
1720
| |
1821
| data moved here
19-
| help: to prevent move, use ref or ref mut: `ref _s`
22+
|
23+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
24+
--> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:24:11
25+
|
26+
LL | let S(_s) = S("foo".to_string());
27+
| ^^
2028

2129
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
2230
--> $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) {
2533
| ^^--^
2634
| | |
2735
| | data moved here
28-
| | help: to prevent move, use ref or ref mut: `ref _s`
2936
| cannot move out of here
37+
|
38+
note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
39+
--> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:28:21
40+
|
41+
LL | fn move_in_fn_arg(S(_s): S) {
42+
| ^^
3043

3144
error: aborting due to 3 previous errors
3245

src/test/ui/borrowck/borrowck-overloaded-index-move-from-vec.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let bad = v[0];
55
| ^^^^
66
| |
77
| cannot move out of borrowed content
8-
| help: consider using a reference instead: `&v[0]`
8+
| help: consider borrowing here: `&v[0]`
99

1010
error: aborting due to previous error
1111

src/test/ui/by-move-pattern-binding.nll.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ LL | match &s.x {
55
| ^^^^ cannot move out of borrowed content
66
LL | &E::Foo => {}
77
LL | &E::Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move
8-
| ----------
9-
| |
10-
| data moved here
11-
| help: to prevent move, use ref or ref mut: `ref identifier`
8+
| -------------------
9+
| | |
10+
| | data moved here
11+
| help: consider removing the `&`: `E::Bar(identifier)`
12+
|
13+
note: move occurs because `identifier` has type `std::string::String`, which does not implement the `Copy` trait
14+
--> $DIR/by-move-pattern-binding.rs:26:17
15+
|
16+
LL | &E::Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move
17+
| ^^^^^^^^^^
1218

1319
error: aborting due to previous error
1420

src/test/ui/check-static-values-constraints.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ LL | let y = { static x: Box<isize> = box 3; x };
5656
| ^
5757
| |
5858
| cannot move out of static item
59-
| help: consider using a reference instead: `&x`
59+
| help: consider borrowing here: `&x`
6060

6161
error[E0010]: allocations are not allowed in statics
6262
--> $DIR/check-static-values-constraints.rs:120:38

0 commit comments

Comments
 (0)