Remove tokenstream::Delimited.#56369
Conversation
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
|
Marking as blocked on #49219. |
|
Why is it blocked on #49219? |
|
☔ The latest upstream changes (presumably #49219) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@nnethercote |
|
#49219 has landed; @nnethercote should be able to rebase this now. :) |
00e699a to
8e4ccef
Compare
|
@eddyb: I have rebased. |
src/libsyntax/tokenstream.rs
Outdated
There was a problem hiding this comment.
(There are many instances of this.)
|
@bors r+ |
|
📌 Commit 8e4ccef845e2870b60b08d77960b550f13ade2d3 has been approved by |
|
In case you'll want to fix #56369 (comment) |
|
✌️ @nnethercote can now approve this pull request |
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`.
8e4ccef to
1fe2c03
Compare
|
I addressed the nits. @bors r=petrochenkov |
|
📌 Commit 1fe2c03 has been approved by |
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`.
|
☀️ Test successful - status-appveyor, status-travis |
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::TokenTreefurther awayfrom the
TokenTreeinquote.rs.More importantly, this change reduces the size of
TokenStreamfrom 48bytes 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_ttandclose_tthave gone from being methods onDelimitedto associated methods ofTokenTree.