about summary refs log tree commit diff
path: root/src/libsyntax/ext/format.rs
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2014-03-02 13:38:44 -0800
committerSteven Fackler <sfackler@gmail.com>2014-03-02 14:12:02 -0800
commita0e54c77612faa9008f95a136ed1674dfcf494ef (patch)
tree9538bd363a1f57d13d755cf570ddeb6d55ed1513 /src/libsyntax/ext/format.rs
parent25431774a933a3b0c5212ea45150660544dec1ec (diff)
downloadrust-a0e54c77612faa9008f95a136ed1674dfcf494ef.tar.gz
rust-a0e54c77612faa9008f95a136ed1674dfcf494ef.zip
Expand string literals and exprs inside of macros
A couple of syntax extensions manually expanded expressions, but it
wasn't done universally, most noticably inside of asm!().

There's also a bit of random cleanup.
Diffstat (limited to 'src/libsyntax/ext/format.rs')
-rw-r--r--src/libsyntax/ext/format.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs
index 7752d885968..b27ea3df21e 100644
--- a/src/libsyntax/ext/format.rs
+++ b/src/libsyntax/ext/format.rs
@@ -843,11 +843,8 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
         fmtsp: sp,
     };
     cx.fmtsp = efmt.span;
-    // Be sure to recursively expand macros just in case the format string uses
-    // a macro to build the format expression.
-    let expr = cx.ecx.expand_expr(efmt);
     let fmt = match expr_to_str(cx.ecx,
-                                expr,
+                                efmt,
                                 "format argument must be a string literal.") {
         Some((fmt, _)) => fmt,
         None => return MacResult::raw_dummy_expr(sp)