about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-09-26 21:13:20 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-09-30 09:11:26 -0700
commit416144b8279fbffceacea6d0fd90e0fd1f8ce53d (patch)
tree0f7f628dd1388f378ac4836e32359b18a7297212 /src/libcollections
parent38015eeb7010e5954a1bc60fddc1214a5f359627 (diff)
downloadrust-416144b8279fbffceacea6d0fd90e0fd1f8ce53d.tar.gz
rust-416144b8279fbffceacea6d0fd90e0fd1f8ce53d.zip
librustc: Forbid `..` in range patterns.
This breaks code that looks like:

    match foo {
        1..3 => { ... }
    }

Instead, write:

    match foo {
        1...3 => { ... }
    }

Closes #17295.

[breaking-change]
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/string.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index a856642c936..d6adbd30264 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -199,10 +199,10 @@ impl String {
                     }
                     3 => {
                         match (byte, safe_get(v, i, total)) {
-                            (0xE0        , 0xA0 .. 0xBF) => (),
-                            (0xE1 .. 0xEC, 0x80 .. 0xBF) => (),
-                            (0xED        , 0x80 .. 0x9F) => (),
-                            (0xEE .. 0xEF, 0x80 .. 0xBF) => (),
+                            (0xE0         , 0xA0 ... 0xBF) => (),
+                            (0xE1 ... 0xEC, 0x80 ... 0xBF) => (),
+                            (0xED         , 0x80 ... 0x9F) => (),
+                            (0xEE ... 0xEF, 0x80 ... 0xBF) => (),
                             _ => {
                                 error!();
                                 continue;
@@ -217,9 +217,9 @@ impl String {
                     }
                     4 => {
                         match (byte, safe_get(v, i, total)) {
-                            (0xF0        , 0x90 .. 0xBF) => (),
-                            (0xF1 .. 0xF3, 0x80 .. 0xBF) => (),
-                            (0xF4        , 0x80 .. 0x8F) => (),
+                            (0xF0         , 0x90 ... 0xBF) => (),
+                            (0xF1 ... 0xF3, 0x80 ... 0xBF) => (),
+                            (0xF4         , 0x80 ... 0x8F) => (),
                             _ => {
                                 error!();
                                 continue;