about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-09-24 17:15:16 +1200
committerNick Cameron <ncameron@mozilla.com>2014-09-29 11:45:20 +1300
commit2c589df6a2f6095eef4fea4ac8f31b2436cf2cb5 (patch)
tree8a2d88a29f0a9bd2c2ac82e929bd4d7ef33ccb03
parent7eb9337dace88c5ded431aa7507f06d50619131b (diff)
downloadrust-2c589df6a2f6095eef4fea4ac8f31b2436cf2cb5.tar.gz
rust-2c589df6a2f6095eef4fea4ac8f31b2436cf2cb5.zip
Test for `..` in range patterns
-rw-r--r--src/test/compile-fail/pat-range-bad-dots.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/compile-fail/pat-range-bad-dots.rs b/src/test/compile-fail/pat-range-bad-dots.rs
new file mode 100644
index 00000000000..5605caaeeed
--- /dev/null
+++ b/src/test/compile-fail/pat-range-bad-dots.rs
@@ -0,0 +1,16 @@
+// 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.
+
+pub fn main() {
+    match 22i {
+        0 .. 3 => {} //~ ERROR expected `=>`, found `..`
+        _ => {}
+    }
+}