summary refs log tree commit diff
path: root/src/libsyntax/parse/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-01 03:11:58 -0800
committerbors <bors@rust-lang.org>2013-12-01 03:11:58 -0800
commitb2aa00ba8b3539985c77f84b01e5781dd1455177 (patch)
tree7db7b6c693714e3254715698b055e6d47787507b /src/libsyntax/parse/mod.rs
parentc470184c20167f9f41613d5f4a1d75840e0f5c3a (diff)
parenta9c4b18b18bd3f5fd4a4c20489f37c52d106fc81 (diff)
downloadrust-b2aa00ba8b3539985c77f84b01e5781dd1455177.tar.gz
rust-b2aa00ba8b3539985c77f84b01e5781dd1455177.zip
auto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmr
**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets.

With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes.

My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**.

I believe there is more to gain by fiddling with the enums' layouts.
Diffstat (limited to 'src/libsyntax/parse/mod.rs')
-rw-r--r--src/libsyntax/parse/mod.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index 54a3dad9495..83825cca631 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -655,10 +655,10 @@ mod test {
                       @ast::item{ident:str_to_ident("a"),
                             attrs:~[],
                             id: ast::DUMMY_NODE_ID,
-                            node: ast::item_fn(ast::fn_decl{
+                            node: ast::item_fn(ast::P(ast::fn_decl{
                                 inputs: ~[ast::arg{
-                                    ty: ast::Ty{id: ast::DUMMY_NODE_ID,
-                                                node: ast::ty_path(ast::Path{
+                                    ty: ast::P(ast::Ty{id: ast::DUMMY_NODE_ID,
+                                                       node: ast::ty_path(ast::Path{
                                         span:sp(10,13),
                                         global:false,
                                         segments: ~[
@@ -671,7 +671,7 @@ mod test {
                                         ],
                                         }, None, ast::DUMMY_NODE_ID),
                                         span:sp(10,13)
-                                    },
+                                    }),
                                     pat: @ast::Pat {
                                         id: ast::DUMMY_NODE_ID,
                                         node: ast::PatIdent(
@@ -694,19 +694,19 @@ mod test {
                                     },
                                     id: ast::DUMMY_NODE_ID
                                 }],
-                                output: ast::Ty{id: ast::DUMMY_NODE_ID,
-                                                 node: ast::ty_nil,
-                                                 span:sp(15,15)}, // not sure
+                                output: ast::P(ast::Ty{id: ast::DUMMY_NODE_ID,
+                                                       node: ast::ty_nil,
+                                                       span:sp(15,15)}), // not sure
                                 cf: ast::return_val,
                                 variadic: false
-                            },
+                            }),
                                     ast::impure_fn,
                                     abi::AbiSet::Rust(),
                                     ast::Generics{ // no idea on either of these:
                                         lifetimes: opt_vec::Empty,
                                         ty_params: opt_vec::Empty,
                                     },
-                                    ast::Block {
+                                    ast::P(ast::Block {
                                         view_items: ~[],
                                         stmts: ~[@Spanned{
                                             node: ast::StmtSemi(@ast::Expr{
@@ -734,7 +734,7 @@ mod test {
                                         id: ast::DUMMY_NODE_ID,
                                         rules: ast::DefaultBlock, // no idea
                                         span: sp(15,21),
-                                    }),
+                                    })),
                             vis: ast::inherited,
                             span: sp(0,21)}));
     }