diff options
5 files changed, 26 insertions, 5 deletions
diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs index d95c4b09994..a3b7a80642a 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs @@ -2,7 +2,10 @@ fn main() { match [5..4, 99..105, 43..44] { - [_, 99.., _] => {}, //~ ERROR unexpected token: `,` + [_, 99.., _] => {}, + //~^ ERROR `X..` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR only char and numeric types are allowed in range patterns _ => {}, } } diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs index 95677e34dd7..197953a1dc4 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs @@ -2,7 +2,11 @@ fn main() { match [5..4, 99..105, 43..44] { - [_, 99..] => {}, //~ ERROR unexpected token: `]` + [_, 99..] => {}, + //~^ ERROR `X..` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR pattern requires 2 elements but array has 3 + //~| ERROR only char and numeric types are allowed in range patterns _ => {}, } } diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs index 3bf5da710ef..782777c1079 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs @@ -2,7 +2,11 @@ fn main() { match [5..4, 99..105, 43..44] { - [..9, 99..100, _] => {}, //~ ERROR expected one of `,` or `]`, found `9` + [..9, 99..100, _] => {}, + //~^ ERROR `..X` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR only char and numeric types are allowed in range patterns + //~| ERROR mismatched types _ => {}, } } diff --git a/src/test/ui/parser/pat-tuple-4.rs b/src/test/ui/parser/pat-tuple-4.rs index 76f60d94bc8..9eedb0f9023 100644 --- a/src/test/ui/parser/pat-tuple-4.rs +++ b/src/test/ui/parser/pat-tuple-4.rs @@ -1,5 +1,10 @@ fn main() { match 0 { - (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat` + (.. pat) => {} + //~^ ERROR `..X` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR cannot find value `pat` in this scope + //~| ERROR exclusive range pattern syntax is experimental + //~| ERROR only char and numeric types are allowed in range patterns } } diff --git a/src/test/ui/parser/pat-tuple-5.rs b/src/test/ui/parser/pat-tuple-5.rs index d4f05a5eb52..5e191ca88e2 100644 --- a/src/test/ui/parser/pat-tuple-5.rs +++ b/src/test/ui/parser/pat-tuple-5.rs @@ -1,5 +1,10 @@ fn main() { match (0, 1) { - (pat ..) => {} //~ ERROR unexpected token: `)` + (pat ..) => {} + //~^ ERROR `X..` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR cannot find value `pat` in this scope + //~| ERROR exclusive range pattern syntax is experimental + //~| ERROR only char and numeric types are allowed in range patterns } } |
