Skip to content

Commit e5b378b

Browse files
committed
Update the expected error output to reflect changes in this PR.
1 parent 9b24595 commit e5b378b

3 files changed

+63
-38
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
error[E0507]: cannot move out of borrowed content
1+
error[E0508]: cannot move out of type `[Foo]`, a non-copy slice
22
--> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
33
|
44
LL | &[Foo { string: a },
5-
| ^ cannot move out of borrowed content
5+
| ^ cannot move out of here
66

7-
error[E0507]: cannot move out of borrowed content
7+
error[E0508]: cannot move out of type `[Foo]`, a non-copy slice
88
--> $DIR/borrowck-move-out-of-vec-tail.rs:34:33
99
|
1010
LL | Foo { string: b }] => {
11-
| ^ cannot move out of borrowed content
11+
| ^ cannot move out of here
1212

1313
error: aborting due to 2 previous errors
1414

15-
For more information about this error, try `rustc --explain E0507`.
15+
For more information about this error, try `rustc --explain E0508`.
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,76 @@
1-
error[E0507]: cannot move out of borrowed content
2-
--> $DIR/borrowck-vec-pattern-nesting.rs:42:15
1+
error[E0506]: cannot assign to `vec[..]` because it is borrowed
2+
--> $DIR/borrowck-vec-pattern-nesting.rs:20:13
3+
|
4+
LL | [box ref _a, _, _] => {
5+
| ------ borrow of `vec[..]` occurs here
6+
LL | //~^ borrow of `vec[..]` occurs here
7+
LL | vec[0] = box 4; //~ ERROR cannot assign
8+
| ^^^^^^ assignment to borrowed `vec[..]` occurs here
9+
LL | //~^ assignment to borrowed `vec[..]` occurs here
10+
LL | _a.use_ref();
11+
| -- borrow later used here
12+
13+
error[E0506]: cannot assign to `vec[..]` because it is borrowed
14+
--> $DIR/borrowck-vec-pattern-nesting.rs:33:13
15+
|
16+
LL | &mut [ref _b..] => {
17+
| ------ borrow of `vec[..]` occurs here
18+
LL | //~^ borrow of `vec[..]` occurs here
19+
LL | vec[0] = box 4; //~ ERROR cannot assign
20+
| ^^^^^^ assignment to borrowed `vec[..]` occurs here
21+
LL | //~^ assignment to borrowed `vec[..]` occurs here
22+
LL | _b.use_ref();
23+
| -- borrow later used here
24+
25+
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
26+
--> $DIR/borrowck-vec-pattern-nesting.rs:44:15
327
|
428
LL | &mut [_a, //~ ERROR cannot move out
5-
| ^^ cannot move out of borrowed content
29+
| ^^ cannot move out of here
630

7-
error[E0507]: cannot move out of borrowed content
8-
--> $DIR/borrowck-vec-pattern-nesting.rs:55:13
31+
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
32+
--> $DIR/borrowck-vec-pattern-nesting.rs:57:13
933
|
1034
LL | let a = vec[0]; //~ ERROR cannot move out
11-
| ^^^^^^ cannot move out of borrowed content
35+
| ^^^^^^ cannot move out of here
1236

13-
error[E0507]: cannot move out of borrowed content
14-
--> $DIR/borrowck-vec-pattern-nesting.rs:65:10
37+
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
38+
--> $DIR/borrowck-vec-pattern-nesting.rs:67:10
1539
|
1640
LL | _b] => {}
17-
| ^^ cannot move out of borrowed content
41+
| ^^ cannot move out of here
1842

19-
error[E0507]: cannot move out of borrowed content
20-
--> $DIR/borrowck-vec-pattern-nesting.rs:68:13
43+
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
44+
--> $DIR/borrowck-vec-pattern-nesting.rs:70:13
2145
|
2246
LL | let a = vec[0]; //~ ERROR cannot move out
23-
| ^^^^^^ cannot move out of borrowed content
47+
| ^^^^^^ cannot move out of here
2448

25-
error[E0507]: cannot move out of borrowed content
26-
--> $DIR/borrowck-vec-pattern-nesting.rs:76:15
49+
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
50+
--> $DIR/borrowck-vec-pattern-nesting.rs:78:15
2751
|
2852
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
29-
| ^^ cannot move out of borrowed content
53+
| ^^ cannot move out of here
3054

31-
error[E0507]: cannot move out of borrowed content
32-
--> $DIR/borrowck-vec-pattern-nesting.rs:76:19
55+
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
56+
--> $DIR/borrowck-vec-pattern-nesting.rs:78:19
3357
|
3458
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
35-
| ^^ cannot move out of borrowed content
59+
| ^^ cannot move out of here
3660

37-
error[E0507]: cannot move out of borrowed content
38-
--> $DIR/borrowck-vec-pattern-nesting.rs:76:23
61+
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
62+
--> $DIR/borrowck-vec-pattern-nesting.rs:78:23
3963
|
4064
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
41-
| ^^ cannot move out of borrowed content
65+
| ^^ cannot move out of here
4266

43-
error[E0507]: cannot move out of borrowed content
44-
--> $DIR/borrowck-vec-pattern-nesting.rs:80:13
67+
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
68+
--> $DIR/borrowck-vec-pattern-nesting.rs:82:13
4569
|
4670
LL | let a = vec[0]; //~ ERROR cannot move out
47-
| ^^^^^^ cannot move out of borrowed content
71+
| ^^^^^^ cannot move out of here
4872

49-
error: aborting due to 8 previous errors
73+
error: aborting due to 10 previous errors
5074

51-
For more information about this error, try `rustc --explain E0507`.
75+
Some errors occurred: E0506, E0508.
76+
For more information about an error, try `rustc --explain E0506`.

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | vec[0] = box 4; //~ ERROR cannot assign
88
| ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
99

1010
error[E0506]: cannot assign to `vec[..]` because it is borrowed
11-
--> $DIR/borrowck-vec-pattern-nesting.rs:32:13
11+
--> $DIR/borrowck-vec-pattern-nesting.rs:33:13
1212
|
1313
LL | &mut [ref _b..] => {
1414
| ------ borrow of `vec[..]` occurs here
@@ -17,7 +17,7 @@ LL | vec[0] = box 4; //~ ERROR cannot assign
1717
| ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
1818

1919
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
20-
--> $DIR/borrowck-vec-pattern-nesting.rs:42:14
20+
--> $DIR/borrowck-vec-pattern-nesting.rs:44:14
2121
|
2222
LL | &mut [_a, //~ ERROR cannot move out
2323
| ^-- hint: to prevent move, use `ref _a` or `ref mut _a`
@@ -30,7 +30,7 @@ LL | | ] => {
3030
| |_________^ cannot move out of here
3131

3232
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
33-
--> $DIR/borrowck-vec-pattern-nesting.rs:55:13
33+
--> $DIR/borrowck-vec-pattern-nesting.rs:57:13
3434
|
3535
LL | let a = vec[0]; //~ ERROR cannot move out
3636
| ^^^^^^
@@ -39,7 +39,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
3939
| help: consider using a reference instead: `&vec[0]`
4040

4141
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
42-
--> $DIR/borrowck-vec-pattern-nesting.rs:63:14
42+
--> $DIR/borrowck-vec-pattern-nesting.rs:65:14
4343
|
4444
LL | &mut [ //~ ERROR cannot move out
4545
| ______________^
@@ -50,7 +50,7 @@ LL | | _b] => {}
5050
| hint: to prevent move, use `ref _b` or `ref mut _b`
5151

5252
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
53-
--> $DIR/borrowck-vec-pattern-nesting.rs:68:13
53+
--> $DIR/borrowck-vec-pattern-nesting.rs:70:13
5454
|
5555
LL | let a = vec[0]; //~ ERROR cannot move out
5656
| ^^^^^^
@@ -59,7 +59,7 @@ LL | let a = vec[0]; //~ ERROR cannot move out
5959
| help: consider using a reference instead: `&vec[0]`
6060

6161
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
62-
--> $DIR/borrowck-vec-pattern-nesting.rs:76:14
62+
--> $DIR/borrowck-vec-pattern-nesting.rs:78:14
6363
|
6464
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
6565
| ^--^^--^^--^
@@ -70,7 +70,7 @@ LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
7070
| cannot move out of here
7171

7272
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
73-
--> $DIR/borrowck-vec-pattern-nesting.rs:80:13
73+
--> $DIR/borrowck-vec-pattern-nesting.rs:82:13
7474
|
7575
LL | let a = vec[0]; //~ ERROR cannot move out
7676
| ^^^^^^

0 commit comments

Comments
 (0)