about summary refs log tree commit diff
path: root/src/libstd/num
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/libstd/num
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/libstd/num')
-rw-r--r--src/libstd/num/strconv.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs
index 407c8ea61d9..b15f334e233 100644
--- a/src/libstd/num/strconv.rs
+++ b/src/libstd/num/strconv.rs
@@ -199,8 +199,8 @@ pub fn int_to_str_bytes_common<T: Int>(num: T, radix: uint, sign: SignFormat, f:
             current_digit_signed
         };
         buf[cur] = match current_digit.to_u8().unwrap() {
-            i @ 0..9 => b'0' + i,
-            i        => b'a' + (i - 10),
+            i @ 0...9 => b'0' + i,
+            i         => b'a' + (i - 10),
         };
         cur += 1;