diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-09-26 21:13:20 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-09-30 09:11:26 -0700 |
| commit | 416144b8279fbffceacea6d0fd90e0fd1f8ce53d (patch) | |
| tree | 0f7f628dd1388f378ac4836e32359b18a7297212 /src/libunicode | |
| parent | 38015eeb7010e5954a1bc60fddc1214a5f359627 (diff) | |
| download | rust-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/libunicode')
| -rw-r--r-- | src/libunicode/u_char.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libunicode/u_char.rs b/src/libunicode/u_char.rs index d8665143854..f725cdba64e 100644 --- a/src/libunicode/u_char.rs +++ b/src/libunicode/u_char.rs @@ -22,7 +22,7 @@ use tables::{derived_property, property, general_category, conversions, charwidt /// code point pub fn is_alphabetic(c: char) -> bool { match c { - 'a' .. 'z' | 'A' .. 'Z' => true, + 'a' ... 'z' | 'A' ... 'Z' => true, c if c > '\x7f' => derived_property::Alphabetic(c), _ => false } @@ -52,7 +52,7 @@ pub fn is_XID_continue(c: char) -> bool { derived_property::XID_Continue(c) } #[inline] pub fn is_lowercase(c: char) -> bool { match c { - 'a' .. 'z' => true, + 'a' ... 'z' => true, c if c > '\x7f' => derived_property::Lowercase(c), _ => false } @@ -66,7 +66,7 @@ pub fn is_lowercase(c: char) -> bool { #[inline] pub fn is_uppercase(c: char) -> bool { match c { - 'A' .. 'Z' => true, + 'A' ... 'Z' => true, c if c > '\x7f' => derived_property::Uppercase(c), _ => false } @@ -80,7 +80,7 @@ pub fn is_uppercase(c: char) -> bool { #[inline] pub fn is_whitespace(c: char) -> bool { match c { - ' ' | '\x09' .. '\x0d' => true, + ' ' | '\x09' ... '\x0d' => true, c if c > '\x7f' => property::White_Space(c), _ => false } @@ -111,7 +111,7 @@ pub fn is_control(c: char) -> bool { general_category::Cc(c) } #[inline] pub fn is_digit(c: char) -> bool { match c { - '0' .. '9' => true, + '0' ... '9' => true, c if c > '\x7f' => general_category::N(c), _ => false } |
