about summary refs log tree commit diff
path: root/src/libregex
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/libregex
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/libregex')
-rw-r--r--src/libregex/vm.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libregex/vm.rs b/src/libregex/vm.rs
index 6db07923c4d..085975580b7 100644
--- a/src/libregex/vm.rs
+++ b/src/libregex/vm.rs
@@ -512,7 +512,7 @@ pub fn is_word(c: Option<char>) -> bool {
     };
     // Try the common ASCII case before invoking binary search.
     match c {
-        '_' | '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' => true,
+        '_' | '0' ... '9' | 'a' ... 'z' | 'A' ... 'Z' => true,
         _ => PERLW.binary_search(|&(start, end)| {
             if c >= start && c <= end {
                 Equal