diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-16 10:33:16 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-21 06:54:41 +1100 |
| commit | c290293cf291951825b10830df4bce3bc03aabef (patch) | |
| tree | 30ef4e886eab253df83eb5b89f9a91a85a04a14e /src/test/ui/iterators/iter-sum-overflow-debug.rs | |
| parent | c23a7aa778b0dfeffbf83b099bdf971242c1e1ac (diff) | |
| download | rust-c290293cf291951825b10830df4bce3bc03aabef.tar.gz rust-c290293cf291951825b10830df4bce3bc03aabef.zip | |
Derive `Rustc{En,De}codable` for `TokenStream`.
`TokenStream` used to be a complex type, but it is now just a newtype
around a `Lrc<Vec<TreeAndJoint>>`. Currently it uses custom encoding
that discards the `IsJoint` and custom decoding that adds `NonJoint`
back in for every token tree. This requires building intermediate
`Vec<TokenTree>`s.
This commit makes `TokenStream` derive `Rustc{En,De}codable`. This
simplifies the code, and avoids the creation of the intermediate
vectors, saving up to 3% on various benchmarks. It also changes the AST
JSON output in one test.
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-debug.rs')
0 files changed, 0 insertions, 0 deletions
