diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-06-18 23:16:44 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-06-22 11:19:35 -0700 |
| commit | df626ea137af1436cb2e5eda19c145363db801c9 (patch) | |
| tree | ec48370b31da608a168f3ee56179becac0c846d9 /src/libsyntax | |
| parent | dc4560dc26498573516d833cb2333b54071070e3 (diff) | |
| download | rust-df626ea137af1436cb2e5eda19c145363db801c9.tar.gz rust-df626ea137af1436cb2e5eda19c145363db801c9.zip | |
Fix compiling empty fmt! strings
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/fmt.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 74496ac5359..4425d54987c 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -249,6 +249,11 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, } } + /* Short circuit an easy case up front (won't work otherwise) */ + if pieces.len() == 0 { + return cx.expr_str_uniq(args[0].span, @""); + } + let fmt_sp = args[0].span; let mut n = 0u; let nargs = args.len(); |
