Skip to content

Commit 2411134

Browse files
committed
Update tests wrt. recovery of range patterns.
1 parent 2f55354 commit 2411134

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
fn main() {
44
match [5..4, 99..105, 43..44] {
5-
[_, 99.., _] => {}, //~ ERROR unexpected token: `,`
5+
[_, 99.., _] => {},
6+
//~^ ERROR `X..` range patterns are not supported
7+
//~| ERROR arbitrary expressions aren't allowed in patterns
8+
//~| ERROR only char and numeric types are allowed in range patterns
69
_ => {},
710
}
811
}

src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
fn main() {
44
match [5..4, 99..105, 43..44] {
5-
[_, 99..] => {}, //~ ERROR unexpected token: `]`
5+
[_, 99..] => {},
6+
//~^ ERROR `X..` range patterns are not supported
7+
//~| ERROR arbitrary expressions aren't allowed in patterns
8+
//~| ERROR pattern requires 2 elements but array has 3
9+
//~| ERROR only char and numeric types are allowed in range patterns
610
_ => {},
711
}
812
}

src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
fn main() {
44
match [5..4, 99..105, 43..44] {
5-
[..9, 99..100, _] => {}, //~ ERROR expected one of `,` or `]`, found `9`
5+
[..9, 99..100, _] => {},
6+
//~^ ERROR `..X` range patterns are not supported
7+
//~| ERROR arbitrary expressions aren't allowed in patterns
8+
//~| ERROR only char and numeric types are allowed in range patterns
9+
//~| ERROR mismatched types
610
_ => {},
711
}
812
}

src/test/ui/parser/pat-tuple-4.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
fn main() {
22
match 0 {
3-
(.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat`
3+
(.. pat) => {}
4+
//~^ ERROR `..X` range patterns are not supported
5+
//~| ERROR arbitrary expressions aren't allowed in patterns
6+
//~| ERROR cannot find value `pat` in this scope
7+
//~| ERROR exclusive range pattern syntax is experimental
8+
//~| ERROR only char and numeric types are allowed in range patterns
49
}
510
}

src/test/ui/parser/pat-tuple-5.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
fn main() {
22
match (0, 1) {
3-
(pat ..) => {} //~ ERROR unexpected token: `)`
3+
(pat ..) => {}
4+
//~^ ERROR `X..` range patterns are not supported
5+
//~| ERROR arbitrary expressions aren't allowed in patterns
6+
//~| ERROR cannot find value `pat` in this scope
7+
//~| ERROR exclusive range pattern syntax is experimental
8+
//~| ERROR only char and numeric types are allowed in range patterns
49
}
510
}

0 commit comments

Comments
 (0)