]> git.lizzy.rs Git - rust.git/commit
Remove `tokenstream::Delimited`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 29 Nov 2018 23:02:04 +0000 (10:02 +1100)
committerNicholas Nethercote <nnethercote@mozilla.com>
Mon, 10 Dec 2018 01:10:10 +0000 (12:10 +1100)
commit1fe2c0324006165b0c39ece0ccd7509e19583054
tree5212ff7760cc0de9d347ee40714a5110565a9f82
parentb755501043d5b27b39f94bcadd57c8d5dedfd6ba
Remove `tokenstream::Delimited`.

Because it's an extra type layer that doesn't really help; in a couple
of places it actively gets in the way, and overall removing it makes the
code nicer. It does, however, move `tokenstream::TokenTree` further away
from the `TokenTree` in `quote.rs`.

More importantly, this change reduces the size of `TokenStream` from 48
bytes to 40 bytes on x86-64, which is enough to slightly reduce
instruction counts on numerous benchmarks, the best by 1.5%.

Note that `open_tt` and `close_tt` have gone from being methods on
`Delimited` to associated methods of `TokenTree`.
18 files changed:
src/librustc/hir/lowering.rs
src/librustc/ich/impls_syntax.rs
src/librustc_lint/builtin.rs
src/libsyntax/ast.rs
src/libsyntax/attr/mod.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/quote.rs
src/libsyntax/ext/tt/quoted.rs
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/fold.rs
src/libsyntax/parse/lexer/tokentrees.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/parser.rs
src/libsyntax/parse/token.rs
src/libsyntax/print/pprust.rs
src/libsyntax/tokenstream.rs
src/libsyntax/visit.rs
src/libsyntax_ext/proc_macro_server.rs