summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-12-05 01:10:22 -0800
committerHuon Wilson <dbau.pp+github@gmail.com>2014-12-29 23:55:25 +1100
commit5e5cc6749eb16f2820fe291582ded0b035667612 (patch)
treea9a5da702c47ff1bf8f9d0436a4452e248cdb2f3 /src/libsyntax/ext
parent06f25b7e99b8e05ba5a90f948a78ab32ea5ec457 (diff)
downloadrust-5e5cc6749eb16f2820fe291582ded0b035667612.tar.gz
rust-5e5cc6749eb16f2820fe291582ded0b035667612.zip
Slash the ast::Stmt type from 104 to 24 bytes.
(on platforms with 64-bit pointers.)

The StmtMac variant is rather large and also fairly rare, so let's
optimise the common case.
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/expand.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index f2b6f6bfe16..d2d624fa05e 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -672,7 +672,7 @@ fn expand_stmt(s: Stmt, fld: &mut MacroExpander) -> SmallVector<P<Stmt>> {
         StmtMac(mac, style) => (mac, style),
         _ => return expand_non_macro_stmt(s, fld)
     };
-    let expanded_stmt = match expand_mac_invoc(mac, s.span,
+    let expanded_stmt = match expand_mac_invoc(mac.and_then(|m| m), s.span,
                                                 |r| r.make_stmt(),
                                                 mark_stmt, fld) {
         Some(stmt) => stmt,