summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-01-25 02:17:33 +0000
committerbors <bors@rust-lang.org>2017-01-25 02:17:33 +0000
commitc0d0e68be4f8bb9d8522bd72a7a1b8ef95b84c6c (patch)
tree2df7197e1d4cbf264e68bf7e9ce2df67b60f574a /src/test/parse-fail
parent83c2d95238e3545e7ae9af4873c48b1e3651c164 (diff)
parent98fef41d63a91759790f5bbe4ac746b5c1a670ba (diff)
downloadrust-c0d0e68be4f8bb9d8522bd72a7a1b8ef95b84c6c.tar.gz
rust-c0d0e68be4f8bb9d8522bd72a7a1b8ef95b84c6c.zip
Auto merge of #35712 - oli-obk:exclusive_range_patterns, r=nikomatsakis
exclusive range patterns

adds `..` patterns to the language under a feature gate (`exclusive_range_pattern`).

This allows turning

``` rust
match i {
    0...9 => {},
    10...19 => {},
    20...29 => {},
    _ => {}
}
```

into

``` rust
match i {
    0..10 => {},
    10..20 => {},
    20..30 => {},
    _ => {}
}
```
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/pat-range-bad-dots.rs18
-rw-r--r--src/test/parse-fail/pat-ranges-4.rs2
-rw-r--r--src/test/parse-fail/pat-tuple-5.rs2
3 files changed, 2 insertions, 20 deletions
diff --git a/src/test/parse-fail/pat-range-bad-dots.rs b/src/test/parse-fail/pat-range-bad-dots.rs
deleted file mode 100644
index d2afd26ea9a..00000000000
--- a/src/test/parse-fail/pat-range-bad-dots.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only
-
-pub fn main() {
-    match 22 {
-        0 .. 3 => {} //~ ERROR expected one of `...`, `=>`, `if`, or `|`, found `..`
-        _ => {}
-    }
-}
diff --git a/src/test/parse-fail/pat-ranges-4.rs b/src/test/parse-fail/pat-ranges-4.rs
index 50dcb899527..4bbf387d1c0 100644
--- a/src/test/parse-fail/pat-ranges-4.rs
+++ b/src/test/parse-fail/pat-ranges-4.rs
@@ -11,5 +11,5 @@
 // Parsing of range patterns
 
 fn main() {
-    let 10 - 3 ... 10 = 8; //~ error: expected one of `...`, `:`, `;`, or `=`, found `-`
+    let 10 - 3 ... 10 = 8; //~ error: expected one of `...`, `..`, `:`, `;`, or `=`, found `-`
 }
diff --git a/src/test/parse-fail/pat-tuple-5.rs b/src/test/parse-fail/pat-tuple-5.rs
index 145d1f9d8ec..d528b97b5de 100644
--- a/src/test/parse-fail/pat-tuple-5.rs
+++ b/src/test/parse-fail/pat-tuple-5.rs
@@ -12,6 +12,6 @@
 
 fn main() {
     match 0 {
-        (pat ..) => {} //~ ERROR expected one of `)`, `,`, or `@`, found `..`
+        (pat ..) => {} //~ ERROR unexpected token: `)`
     }
 }