Box Block, fn_decl, variant and Ty in the AST.#10676
Conversation
There was a problem hiding this comment.
I removed this clone, but not others (the variant one just below and some in the parser), any suggestions?
There was a problem hiding this comment.
oddly #2543 was closed by PR #9088 even though this comment remained in the source. I assume @nikomatsakis did mean to close it, since that PR removed a large number of the copies, but clearly not all of them...
|
Should this really use @ box instead of ~ box? |
|
I will try to implement a proper arena, instead of leaking, with safe-ish (always fail on ptr deref) post-drop behavior (maybe by |
|
Nevermind my previous idea, I'm using |
|
What improvements are those in particular? I would like to remove |
|
(Note that this is without -O) |
|
@pcwalton: AFAIK he just means the dereference operator overload |
|
@pcwalton custom (auto-)dereference, (auto-)borrow and (optionally) use-after-move handler - so explicit cloning to split ownership isn't required. |
|
For me, sha 468657c fails |
|
Rebased and updated rustdoc - my bad, I always forget to fix the tests. |
|
Squash and r=me |
… critical enum sizes.
**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.

Note: I only tested on top of my #10670 PR, size reductions come from both change sets.
With this, more enums are shrinked, 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.