Decrease size of Expr and Ty and derive Copy
Summary:
As discussed on {
D21048807}, while the [general guidance for when to implement Copy](https://doc.rust-lang.org/std/marker/trait.Copy.html#when-should-my-type-be-copy) suggests that any type that *can* be Copy *should* be, not implementing Copy on large structs can be a helpful bumper reducing the incidence of accidental perf regressions (even if it doesn't *prevent* copying the large struct, since the compiler may still emit memcpys to implement moves). As a result, in this diff, we implement Copy only for a few small (i.e., with a size of three words or less) types for which a Copy implementation is convenient in the direct-decl-parser.
To reduce the size of Ty_ to three words, I boxed each variant's fields (as we do with aast::Expr_, aast::Stmt_, etc). To reduce the size of Ty to two words, I put the typing reason behind a reference. To reduce the size of Expr (as well as many other types), I removed the implementation of Copy from Pos, and always put it behind a reference (although it is only three words, positions are often copied into several places. Also, without the reference, larger structs can end up inlining several positions, paying that two-word overhead many times over).
Differential Revision:
D21144457
fbshipit-source-id:
f34b03b0ebf2d3a3fe572e71d6395517145d9a9b