about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-11-05 15:30:32 +0100
committerSteve Klabnik <steve@steveklabnik.com>2015-11-05 15:30:34 +0100
commit63576c23e41092ae16c57e15977bf10e72327799 (patch)
tree2fb9960c65b2d703592121d069b8bb3fcc2fbb9a /src/libsyntax/ext
parenta216e847272ddbd3033037b606eaf2d801c250b9 (diff)
downloadrust-63576c23e41092ae16c57e15977bf10e72327799.tar.gz
rust-63576c23e41092ae16c57e15977bf10e72327799.zip
remove excess string allocation
&format!("...") is the same as "" if we're not doing any interpolation,
and doesn't allocate an intermediate String.
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/expand.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index b1b4605d5ec..512f71fd4c1 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -400,9 +400,7 @@ pub fn expand_item_mac(it: P<ast::Item>,
                 }
                 MacroRulesTT => {
                     if ident.name == parse::token::special_idents::invalid.name {
-                        fld.cx.span_err(path_span,
-                                        &format!("macro_rules! expects an ident argument")
-                                        );
+                        fld.cx.span_err(path_span, "macro_rules! expects an ident argument");
                         return SmallVector::zero();
                     }