Skip to content

Commit a6be8d3

Browse files
committed
auto merge of #9140 : alexcrichton/rust/issue-9119, r=huonw
Closes #9119
2 parents 248765a + a018a5c commit a6be8d3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/libstd/fmt/parse.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ impl<'self> Parser<'self> {
554554
/// characters.
555555
fn word(&mut self) -> &'self str {
556556
let start = match self.cur.clone().next() {
557-
Some((pos, c)) if char::is_alphabetic(c) => {
557+
Some((pos, c)) if char::is_XID_start(c) => {
558558
self.cur.next();
559559
pos
560560
}
@@ -563,7 +563,7 @@ impl<'self> Parser<'self> {
563563
let mut end;
564564
loop {
565565
match self.cur.clone().next() {
566-
Some((_, c)) if char::is_alphanumeric(c) => {
566+
Some((_, c)) if char::is_XID_continue(c) => {
567567
self.cur.next();
568568
}
569569
Some((pos, _)) => { end = pos; break }

src/test/run-pass/ifmt.rs

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub fn main() {
8787
t!(format!("{foo} {1} {bar} {0}", 0, 1, foo=2, bar=3), "2 1 3 0");
8888
t!(format!("{} {0:s}", "a"), "a a");
8989
t!(format!("{} {0}", "a"), "a a");
90+
t!(format!("{foo_bar}", foo_bar=1), "1");
9091

9192
// Methods should probably work
9293
t!(format!("{0, plural, =1{a#} =2{b#} zero{c#} other{d#}}", 0u), "c0");

0 commit comments

Comments
 (0)