Skip to content

Commit 7fef614

Browse files
committed
--bless tests due to new subslice syntax.
1 parent 98d6269 commit 7fef614

14 files changed

+95
-56
lines changed

src/test/ui/borrowck/borrowck-describe-lvalue.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ error[E0503]: cannot use `v[..]` because it was mutably borrowed
192192
LL | let x = &mut v;
193193
| ------ borrow of `v` occurs here
194194
LL | match v {
195-
LL | &[x..] => println!("{:?}", x),
196-
| ^ use of borrowed `v`
195+
LL | &[x @ ..] => println!("{:?}", x),
196+
| ^^^^^^ use of borrowed `v`
197197
...
198198
LL | drop(x);
199199
| - borrow later used here
@@ -204,8 +204,8 @@ error[E0503]: cannot use `v[..]` because it was mutably borrowed
204204
LL | let x = &mut v;
205205
| ------ borrow of `v` occurs here
206206
...
207-
LL | &[_, x..] => println!("{:?}", x),
208-
| ^ use of borrowed `v`
207+
LL | &[_, x @ ..] => println!("{:?}", x),
208+
| ^^^^^^ use of borrowed `v`
209209
...
210210
LL | drop(x);
211211
| - borrow later used here
@@ -216,8 +216,8 @@ error[E0503]: cannot use `v[..]` because it was mutably borrowed
216216
LL | let x = &mut v;
217217
| ------ borrow of `v` occurs here
218218
...
219-
LL | &[x.., _] => println!("{:?}", x),
220-
| ^ use of borrowed `v`
219+
LL | &[x @ .., _] => println!("{:?}", x),
220+
| ^^^^^^ use of borrowed `v`
221221
...
222222
LL | drop(x);
223223
| - borrow later used here
@@ -228,8 +228,8 @@ error[E0503]: cannot use `v[..]` because it was mutably borrowed
228228
LL | let x = &mut v;
229229
| ------ borrow of `v` occurs here
230230
...
231-
LL | &[_, x.., _] => println!("{:?}", x),
232-
| ^ use of borrowed `v`
231+
LL | &[_, x @ .., _] => println!("{:?}", x),
232+
| ^^^^^^ use of borrowed `v`
233233
...
234234
LL | drop(x);
235235
| - borrow later used here

src/test/ui/borrowck/borrowck-move-out-from-array.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ error[E0382]: use of moved value: `a[..]`
1313
|
1414
LL | let [_x, _] = a;
1515
| -- value moved here
16-
LL | let [_y..] = a;
17-
| ^^ value used here after move
16+
LL | let [_y @ ..] = a;
17+
| ^^^^^^^ value used here after move
1818
|
1919
= note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
2020

src/test/ui/borrowck/borrowck-slice-pattern-element-loan.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
8989
|
9090
LL | if let [ref first, ref second, ..] = *s {
9191
| ---------- immutable borrow occurs here
92-
LL | if let [_, ref mut tail..] = *s {
93-
| ^^^^^^^^^^^^ mutable borrow occurs here
92+
LL | if let [_, ref mut tail @ ..] = *s {
93+
| ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
9494
LL | nop(&[first, second]);
9595
| ------ immutable borrow later used here
9696

@@ -99,18 +99,18 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
9999
|
100100
LL | if let [.., ref second, ref first] = *s {
101101
| ---------- immutable borrow occurs here
102-
LL | if let [ref mut tail.., _] = *s {
103-
| ^^^^^^^^^^^^ mutable borrow occurs here
102+
LL | if let [ref mut tail @ .., _] = *s {
103+
| ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
104104
LL | nop(&[first, second]);
105105
| ------ immutable borrow later used here
106106

107107
error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
108108
--> $DIR/borrowck-slice-pattern-element-loan.rs:109:17
109109
|
110-
LL | if let [_, _, _, ref s1..] = *s {
111-
| ------ immutable borrow occurs here
112-
LL | if let [ref mut s2.., _, _, _] = *s {
113-
| ^^^^^^^^^^ mutable borrow occurs here
110+
LL | if let [_, _, _, ref s1 @ ..] = *s {
111+
| ----------- immutable borrow occurs here
112+
LL | if let [ref mut s2 @ .., _, _, _] = *s {
113+
| ^^^^^^^^^^^^^^^ mutable borrow occurs here
114114
LL | nop_subslice(s1);
115115
| -- immutable borrow later used here
116116

src/test/ui/borrowck/borrowck-vec-pattern-move-tail.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0506]: cannot assign to `a[_]` because it is borrowed
22
--> $DIR/borrowck-vec-pattern-move-tail.rs:12:5
33
|
4-
LL | [1, 2, ref tail..] => tail,
5-
| -------- borrow of `a[_]` occurs here
4+
LL | [1, 2, ref tail @ ..] => tail,
5+
| ------------- borrow of `a[_]` occurs here
66
...
77
LL | a[2] = 0;
88
| ^^^^^^^^ assignment to borrowed `a[_]` occurs here

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | _a.use_ref();
1313
error[E0506]: cannot assign to `vec[_]` because it is borrowed
1414
--> $DIR/borrowck-vec-pattern-nesting.rs:24:13
1515
|
16-
LL | &mut [ref _b..] => {
17-
| ------ borrow of `vec[_]` occurs here
16+
LL | &mut [ref _b @ ..] => {
17+
| ----------- borrow of `vec[_]` occurs here
1818
LL |
1919
LL | vec[0] = box 4;
2020
| ^^^^^^ assignment to borrowed `vec[_]` occurs here

src/test/ui/error-codes/E0528.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0528]: pattern requires at least 3 elements but array has 2
22
--> $DIR/E0528.rs:6:10
33
|
4-
LL | &[a, b, c, rest..] => {
5-
| ^^^^^^^^^^^^^^^^^ pattern cannot match array of 2 elements
4+
LL | &[a, b, c, rest @ ..] => {
5+
| ^^^^^^^^^^^^^^^^^^^^ pattern cannot match array of 2 elements
66

77
error: aborting due to previous error
88

src/test/ui/feature-gates/feature-gate-slice-patterns.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
fn main() {
44
let x = [1, 2, 3, 4, 5];
55
match x {
6-
[1, 2, ..] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
7-
[1, .., 5] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
8-
[.., 4, 5] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
6+
[1, 2, ..] => {} //~ ERROR subslice patterns are unstable
7+
[1, .., 5] => {} //~ ERROR subslice patterns are unstable
8+
[.., 4, 5] => {} //~ ERROR subslice patterns are unstable
99
}
1010

1111
let x = [ 1, 2, 3, 4, 5 ];
1212
match x {
13-
[ xs @ .., 4, 5 ] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
14-
[ 1, xs @ .., 5 ] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
15-
[ 1, 2, xs @ .. ] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
13+
[ xs @ .., 4, 5 ] => {} //~ ERROR subslice patterns are unstable
14+
[ 1, xs @ .., 5 ] => {} //~ ERROR subslice patterns are unstable
15+
[ 1, 2, xs @ .. ] => {} //~ ERROR subslice patterns are unstable
1616
}
1717
}

src/test/ui/feature-gates/feature-gate-slice-patterns.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: syntax for subslices in slice patterns is not yet stabilized
1+
error[E0658]: subslice patterns are unstable
22
--> $DIR/feature-gate-slice-patterns.rs:6:16
33
|
44
LL | [1, 2, ..] => {}
@@ -7,7 +7,7 @@ LL | [1, 2, ..] => {}
77
= note: for more information, see https://github.com/rust-lang/rust/issues/62254
88
= help: add `#![feature(slice_patterns)]` to the crate attributes to enable
99

10-
error[E0658]: syntax for subslices in slice patterns is not yet stabilized
10+
error[E0658]: subslice patterns are unstable
1111
--> $DIR/feature-gate-slice-patterns.rs:7:13
1212
|
1313
LL | [1, .., 5] => {}
@@ -16,7 +16,7 @@ LL | [1, .., 5] => {}
1616
= note: for more information, see https://github.com/rust-lang/rust/issues/62254
1717
= help: add `#![feature(slice_patterns)]` to the crate attributes to enable
1818

19-
error[E0658]: syntax for subslices in slice patterns is not yet stabilized
19+
error[E0658]: subslice patterns are unstable
2020
--> $DIR/feature-gate-slice-patterns.rs:8:10
2121
|
2222
LL | [.., 4, 5] => {}
@@ -25,29 +25,29 @@ LL | [.., 4, 5] => {}
2525
= note: for more information, see https://github.com/rust-lang/rust/issues/62254
2626
= help: add `#![feature(slice_patterns)]` to the crate attributes to enable
2727

28-
error[E0658]: syntax for subslices in slice patterns is not yet stabilized
28+
error[E0658]: subslice patterns are unstable
2929
--> $DIR/feature-gate-slice-patterns.rs:13:11
3030
|
31-
LL | [ xs.., 4, 5 ] => {}
32-
| ^^
31+
LL | [ xs @ .., 4, 5 ] => {}
32+
| ^^^^^^^
3333
|
3434
= note: for more information, see https://github.com/rust-lang/rust/issues/62254
3535
= help: add `#![feature(slice_patterns)]` to the crate attributes to enable
3636

37-
error[E0658]: syntax for subslices in slice patterns is not yet stabilized
37+
error[E0658]: subslice patterns are unstable
3838
--> $DIR/feature-gate-slice-patterns.rs:14:14
3939
|
40-
LL | [ 1, xs.., 5 ] => {}
41-
| ^^
40+
LL | [ 1, xs @ .., 5 ] => {}
41+
| ^^^^^^^
4242
|
4343
= note: for more information, see https://github.com/rust-lang/rust/issues/62254
4444
= help: add `#![feature(slice_patterns)]` to the crate attributes to enable
4545

46-
error[E0658]: syntax for subslices in slice patterns is not yet stabilized
46+
error[E0658]: subslice patterns are unstable
4747
--> $DIR/feature-gate-slice-patterns.rs:15:17
4848
|
49-
LL | [ 1, 2, xs.. ] => {}
50-
| ^^
49+
LL | [ 1, 2, xs @ .. ] => {}
50+
| ^^^^^^^
5151
|
5252
= note: for more information, see https://github.com/rust-lang/rust/issues/62254
5353
= help: add `#![feature(slice_patterns)]` to the crate attributes to enable

src/test/ui/issues/issue-12369.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: unreachable pattern
22
--> $DIR/issue-12369.rs:10:9
33
|
4-
LL | &[10,a, ref rest..] => 10
5-
| ^^^^^^^^^^^^^^^^^^^
4+
LL | &[10,a, ref rest @ ..] => 10
5+
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: lint level defined here
88
--> $DIR/issue-12369.rs:2:9

src/test/ui/match/match-vec-mismatch.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ LL | [0] => {},
1919
error[E0528]: pattern requires at least 4 elements but array has 3
2020
--> $DIR/match-vec-mismatch.rs:25:9
2121
|
22-
LL | [0, 1, 2, 3, x..] => {}
23-
| ^^^^^^^^^^^^^^^^^ pattern cannot match array of 3 elements
22+
LL | [0, 1, 2, 3, x @ ..] => {}
23+
| ^^^^^^^^^^^^^^^^^^^^ pattern cannot match array of 3 elements
2424

2525
error[E0282]: type annotations needed
2626
--> $DIR/match-vec-mismatch.rs:36:9

0 commit comments

Comments
 (0)