Skip to content

Commit 9a0020a

Browse files
committed
Bless UI tests
1 parent d6dbdee commit 9a0020a

13 files changed

+231
-121
lines changed

src/test/ui/borrowck/borrowck-move-error-with-note.nll.stderr

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,24 @@ LL | match *f { //~ ERROR cannot move out of
55
| ^^
66
| |
77
| cannot move out of borrowed content
8-
| help: consider removing this dereference operator: `f`
8+
| help: consider removing the `*`: `f`
99
LL | //~| cannot move out
1010
LL | Foo::Foo1(num1,
11-
| ---- move occurs because num1 has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
11+
| ---- data moved here
1212
LL | num2) => (),
13-
| ---- move occurs because num2 has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
13+
| ---- ...and here
1414
LL | Foo::Foo2(num) => (),
15-
| --- move occurs because num has type `std::boxed::Box<u32>`, which does not implement the `Copy` trait
15+
| --- ...and here
16+
|
17+
note: move occurs because these variables have types that don't implement the `Copy` trait
18+
--> $DIR/borrowck-move-error-with-note.rs:23:19
19+
|
20+
LL | Foo::Foo1(num1,
21+
| ^^^^
22+
LL | num2) => (),
23+
| ^^^^
24+
LL | Foo::Foo2(num) => (),
25+
| ^^^
1626

1727
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
1828
--> $DIR/borrowck-move-error-with-note.rs:39:11
@@ -23,12 +33,15 @@ LL | match (S {f: "foo".to_string(), g: "bar".to_string()}) {
2333
LL | f: _s,
2434
| -- data moved here
2535
LL | g: _t
26-
| -- ... and here
27-
help: to prevent move, use ref or ref mut
36+
| -- ...and here
2837
|
29-
LL | f: ref _s,
30-
LL | g: ref _t
38+
note: move occurs because these variables have types that don't implement the `Copy` trait
39+
--> $DIR/borrowck-move-error-with-note.rs:42:16
3140
|
41+
LL | f: _s,
42+
| ^^
43+
LL | g: _t
44+
| ^^
3245

3346
error[E0507]: cannot move out of borrowed content
3447
--> $DIR/borrowck-move-error-with-note.rs:57:11
@@ -37,10 +50,16 @@ LL | match a.a { //~ ERROR cannot move out of
3750
| ^^^
3851
| |
3952
| cannot move out of borrowed content
40-
| help: consider using a reference instead: `&a.a`
53+
| help: consider borrowing here: `&a.a`
4154
LL | //~| cannot move out
4255
LL | n => {
43-
| - move occurs because n has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
56+
| - data moved here
57+
|
58+
note: move occurs because `n` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
59+
--> $DIR/borrowck-move-error-with-note.rs:59:9
60+
|
61+
LL | n => {
62+
| ^
4463

4564
error: aborting due to 3 previous errors
4665

src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ LL | &[Foo { string: a },
77
| - data moved here
88
...
99
LL | Foo { string: b }] => {
10-
| - ... and here
11-
help: to prevent move, use ref or ref mut
10+
| - ...and here
1211
|
13-
LL | &[Foo { string: ref a },
12+
note: move occurs because these variables have types that don't implement the `Copy` trait
13+
--> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
14+
|
15+
LL | &[Foo { string: a },
16+
| ^
17+
...
18+
LL | Foo { string: b }] => {
19+
| ^
20+
help: consider removing the `&`
21+
|
22+
LL | [Foo { string: a },
1423
LL | //~^ ERROR cannot move out of type `[Foo]`
1524
LL | //~| cannot move out
1625
LL | //~| to prevent move
17-
LL | Foo { string: ref b }] => {
26+
LL | Foo { string: b }] => {
1827
|
1928

2029
error: aborting due to previous error

src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,21 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
2828
LL | match vec {
2929
| ^^^ cannot move out of here
3030
LL | &mut [_a, //~ ERROR cannot move out
31-
| --
32-
| |
33-
| data moved here
34-
| help: to prevent move, use ref or ref mut: `ref _a`
31+
| -- data moved here
32+
|
33+
note: move occurs because `_a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
34+
--> $DIR/borrowck-vec-pattern-nesting.rs:44:15
35+
|
36+
LL | &mut [_a, //~ ERROR cannot move out
37+
| ^^
38+
help: consider removing the `&mut`
39+
|
40+
LL | [_a, //~ ERROR cannot move out
41+
LL | //~| cannot move out
42+
LL | //~| to prevent move
43+
LL | ..
44+
LL | ] => {
45+
|
3546

3647
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
3748
--> $DIR/borrowck-vec-pattern-nesting.rs:57:13
@@ -40,7 +51,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
4051
| ^^^^^^
4152
| |
4253
| cannot move out of here
43-
| help: consider using a reference instead: `&vec[0]`
54+
| help: consider borrowing here: `&vec[0]`
4455

4556
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
4657
--> $DIR/borrowck-vec-pattern-nesting.rs:64:11
@@ -49,10 +60,19 @@ LL | match vec {
4960
| ^^^ cannot move out of here
5061
...
5162
LL | _b] => {}
52-
| --
53-
| |
54-
| data moved here
55-
| help: to prevent move, use ref or ref mut: `ref _b`
63+
| -- data moved here
64+
|
65+
note: move occurs because `_b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
66+
--> $DIR/borrowck-vec-pattern-nesting.rs:67:10
67+
|
68+
LL | _b] => {}
69+
| ^^
70+
help: consider removing the `&mut`
71+
|
72+
LL | [ //~ ERROR cannot move out
73+
LL | //~^ cannot move out
74+
LL | _b] => {}
75+
|
5676

5777
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
5878
--> $DIR/borrowck-vec-pattern-nesting.rs:70:13
@@ -61,22 +81,26 @@ LL | let a = vec[0]; //~ ERROR cannot move out
6181
| ^^^^^^
6282
| |
6383
| cannot move out of here
64-
| help: consider using a reference instead: `&vec[0]`
84+
| help: consider borrowing here: `&vec[0]`
6585

6686
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
6787
--> $DIR/borrowck-vec-pattern-nesting.rs:77:11
6888
|
6989
LL | match vec {
7090
| ^^^ cannot move out of here
7191
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
72-
| -- -- -- ... and here
73-
| | |
74-
| | ... and here
75-
| data moved here
76-
help: to prevent move, use ref or ref mut
77-
|
78-
LL | &mut [ref _a, ref _b, ref _c] => {} //~ ERROR cannot move out
79-
| ^^^^^^ ^^^^^^ ^^^^^^
92+
| -----------------
93+
| | | | |
94+
| | | | ...and here
95+
| | | ...and here
96+
| | data moved here
97+
| help: consider removing the `&mut`: `[_a, _b, _c]`
98+
|
99+
note: move occurs because these variables have types that don't implement the `Copy` trait
100+
--> $DIR/borrowck-vec-pattern-nesting.rs:78:15
101+
|
102+
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
103+
| ^^ ^^ ^^
80104

81105
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
82106
--> $DIR/borrowck-vec-pattern-nesting.rs:82:13
@@ -85,7 +109,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
85109
| ^^^^^^
86110
| |
87111
| cannot move out of here
88-
| help: consider using a reference instead: `&vec[0]`
112+
| help: consider borrowing here: `&vec[0]`
89113

90114
error: aborting due to 8 previous errors
91115

src/test/ui/borrowck/issue-51415.nll.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ LL | let opt = a.iter().enumerate().find(|(_, &s)| {
55
| ^^^^^-^
66
| | |
77
| | data moved here
8-
| | help: to prevent move, use ref or ref mut: `ref s`
98
| cannot move out of borrowed content
9+
|
10+
note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
11+
--> $DIR/issue-51415.rs:16:47
12+
|
13+
LL | let opt = a.iter().enumerate().find(|(_, &s)| {
14+
| ^
1015

1116
error: aborting due to previous error
1217

src/test/ui/codemap_tests/overlapping_spans.nll.stderr

Lines changed: 7 additions & 4 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 {f:"foo".to_string()}) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
66
LL | S {f:_s} => {} //~ ERROR cannot move out
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/overlapping_spans.rs:21:14
11+
|
12+
LL | S {f:_s} => {} //~ ERROR cannot move out
13+
| ^^
1114

1215
error: aborting due to previous error
1316

src/test/ui/issues/issue-12567.nll.stderr

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
88
| -- data moved here
99
...
1010
LL | (&[hd1, ..], &[hd2, ..])
11-
| --- ... and here
12-
help: to prevent move, use ref or ref mut
11+
| --- ...and here
1312
|
14-
LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[])
15-
LL | => println!("one empty"),
16-
LL | //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice
17-
LL | //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice
18-
LL | (&[hd1, ..], &[ref hd2, ..])
13+
note: move occurs because these variables have types that don't implement the `Copy` trait
14+
--> $DIR/issue-12567.rs:16:17
1915
|
16+
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
17+
| ^^
18+
...
19+
LL | (&[hd1, ..], &[hd2, ..])
20+
| ^^^
2021

2122
error[E0508]: cannot move out of type `[T]`, a non-copy slice
2223
--> $DIR/issue-12567.rs:14:11
@@ -28,15 +29,16 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
2829
| -- data moved here
2930
...
3031
LL | (&[hd1, ..], &[hd2, ..])
31-
| --- ... and here
32-
help: to prevent move, use ref or ref mut
32+
| --- ...and here
3333
|
34-
LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[])
35-
LL | => println!("one empty"),
36-
LL | //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice
37-
LL | //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice
38-
LL | (&[ref hd1, ..], &[hd2, ..])
34+
note: move occurs because these variables have types that don't implement the `Copy` trait
35+
--> $DIR/issue-12567.rs:16:17
3936
|
37+
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
38+
| ^^
39+
...
40+
LL | (&[hd1, ..], &[hd2, ..])
41+
| ^^^
4042

4143
error: aborting due to 2 previous errors
4244

src/test/ui/issues/issue-20801.nll.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let a = unsafe { *mut_ref() };
55
| ^^^^^^^^^^
66
| |
77
| cannot move out of borrowed content
8-
| help: consider using a reference instead: `&*mut_ref()`
8+
| help: consider removing the `*`: `mut_ref()`
99

1010
error[E0507]: cannot move out of borrowed content
1111
--> $DIR/issue-20801.rs:39:22
@@ -14,7 +14,7 @@ LL | let b = unsafe { *imm_ref() };
1414
| ^^^^^^^^^^
1515
| |
1616
| cannot move out of borrowed content
17-
| help: consider using a reference instead: `&*imm_ref()`
17+
| help: consider removing the `*`: `imm_ref()`
1818

1919
error[E0507]: cannot move out of borrowed content
2020
--> $DIR/issue-20801.rs:42:22
@@ -23,7 +23,7 @@ LL | let c = unsafe { *mut_ptr() };
2323
| ^^^^^^^^^^
2424
| |
2525
| cannot move out of borrowed content
26-
| help: consider using a reference instead: `&*mut_ptr()`
26+
| help: consider removing the `*`: `mut_ptr()`
2727

2828
error[E0507]: cannot move out of borrowed content
2929
--> $DIR/issue-20801.rs:45:22
@@ -32,7 +32,7 @@ LL | let d = unsafe { *const_ptr() };
3232
| ^^^^^^^^^^^^
3333
| |
3434
| cannot move out of borrowed content
35-
| help: consider using a reference instead: `&*const_ptr()`
35+
| help: consider removing the `*`: `const_ptr()`
3636

3737
error: aborting due to 4 previous errors
3838

src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.nll.stderr

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

1010
error: aborting due to previous error
1111

src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.nll.stderr

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ LL | let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
55
| - - ^^^^
66
| | | |
77
| | | cannot move out of borrowed content
8-
| | | help: consider using a reference instead: `&x[0]`
9-
| | move occurs because b has type `std::string::String`, which does not implement the `Copy` trait
10-
| move occurs because a has type `std::string::String`, which does not implement the `Copy` trait
8+
| | | help: consider borrowing here: `&x[0]`
9+
| | ...and here
10+
| data moved here
11+
|
12+
note: move occurs because these variables have types that don't implement the `Copy` trait
13+
--> $DIR/issue-40402-2.rs:15:10
14+
|
15+
LL | let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
16+
| ^ ^
1117

1218
error: aborting due to previous error
1319

src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ LL | match hellothere.x { //~ ERROR cannot move out
55
| ^^^^^^^^^^^^
66
| |
77
| cannot move out of borrowed content
8-
| help: consider using a reference instead: `&hellothere.x`
8+
| help: consider borrowing here: `&hellothere.x`
99
...
1010
LL | box E::Bar(x) => println!("{}", x.to_string()),
11-
| - move occurs because x has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
11+
| - data moved here
12+
|
13+
note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
14+
--> $DIR/moves-based-on-type-block-bad.rs:37:28
15+
|
16+
LL | box E::Bar(x) => println!("{}", x.to_string()),
17+
| ^
1218

1319
error: aborting due to previous error
1420

0 commit comments

Comments
 (0)