]> git.lizzy.rs Git - rust.git/commitdiff
Update tests wrt. recovery of range patterns.
authorMazdak Farrokhzad <twingoow@gmail.com>
Tue, 9 Jul 2019 06:44:46 +0000 (08:44 +0200)
committerMazdak Farrokhzad <twingoow@gmail.com>
Sun, 28 Jul 2019 04:53:38 +0000 (06:53 +0200)
src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs
src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs
src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs
src/test/ui/parser/pat-tuple-4.rs
src/test/ui/parser/pat-tuple-5.rs

index d95c4b09994050b0e9323b1690934d1781efe5ec..a3b7a80642a72b2d7bd5e482258ed7c0fb83f184 100644 (file)
@@ -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
         _ => {},
     }
 }
index 95677e34dd798e55044b74ec3621e35194f951a6..197953a1dc4ba020bd687e44ba300494cec23e92 100644 (file)
@@ -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
         _ => {},
     }
 }
index 3bf5da710ef9f9c0ee32b389e7b077a56c093309..782777c10797dade8fc38c945cbae445d03703c4 100644 (file)
@@ -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
         _ => {},
     }
 }
index 76f60d94bc86ea750c3062e53371b1a59a0825f4..9eedb0f90234273089c4aa37f209796b2d8b131a 100644 (file)
@@ -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
     }
 }
index d4f05a5eb523ee6053a2b4e3e7ff1d8b6bea8670..5e191ca88e2967309276356121d53f8b1a3b456f 100644 (file)
@@ -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
     }
 }