Skip to content

Commit 6e098a9

Browse files
committed
---
yaml --- r: 63565 b: refs/heads/snap-stage3 c: df166ba h: refs/heads/master i: 63563: f0d45c2 v: v3
1 parent 61089ee commit 6e098a9

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: ef07d7c46e80fc607df81d8d572fe0c9881a4f42
4+
refs/heads/snap-stage3: df166bae1ff583b39b4046becc87d28c9f90094b
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libsyntax/ext/fmt.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span,
249249
}
250250
}
251251

252+
/* Short circuit an easy case up front (won't work otherwise) */
253+
if pieces.len() == 0 {
254+
return cx.expr_str_uniq(args[0].span, @"");
255+
}
256+
252257
let fmt_sp = args[0].span;
253258
let mut n = 0u;
254259
let nargs = args.len();

branches/snap-stage3/src/test/run-pass/syntax-extension-fmt.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ fn part1() {
5858
test(fmt!("%x", 0xffffffff_u), ~"ffffffff");
5959
test(fmt!("%o", 0xffffffff_u), ~"37777777777");
6060
test(fmt!("%t", 0xffffffff_u), ~"11111111111111111111111111111111");
61+
62+
// Don't result in a compilation error
63+
test(fmt!(""), ~"");
6164
}
6265
fn part2() {
6366
// Widths

0 commit comments

Comments
 (0)