about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-09-12 00:50:19 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-09-12 01:07:10 -0700
commita018a5c3433e20a56f642082586f4e4d28469381 (patch)
tree42c6064f15a48bb8e3152266d1693285faf3036a /src/libstd
parent03ca1befb31e711fa6ed74e1dd454c5be55694c4 (diff)
downloadrust-a018a5c3433e20a56f642082586f4e4d28469381.tar.gz
rust-a018a5c3433e20a56f642082586f4e4d28469381.zip
Parse underscores in identifiers for format!
Closes #9119
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/fmt/parse.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/fmt/parse.rs b/src/libstd/fmt/parse.rs
index fd0e86d7a31..9888af9313b 100644
--- a/src/libstd/fmt/parse.rs
+++ b/src/libstd/fmt/parse.rs
@@ -554,7 +554,7 @@ impl<'self> Parser<'self> {
     /// characters.
     fn word(&mut self) -> &'self str {
         let start = match self.cur.clone().next() {
-            Some((pos, c)) if char::is_alphabetic(c) => {
+            Some((pos, c)) if char::is_XID_start(c) => {
                 self.cur.next();
                 pos
             }
@@ -563,7 +563,7 @@ impl<'self> Parser<'self> {
         let mut end;
         loop {
             match self.cur.clone().next() {
-                Some((_, c)) if char::is_alphanumeric(c) => {
+                Some((_, c)) if char::is_XID_continue(c) => {
                     self.cur.next();
                 }
                 Some((pos, _)) => { end = pos; break }