Uh oh!
There was an error while loading. Please reload this page.
Make TokenStream less recursive. - #57004
Conversation
rust-highfive
commented
Dec 20, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
Dec 24, 2018
☔ The latest upstream changes (presumably #57087) made this pull request unmergeable. Please resolve the merge conflicts. |
e2e57bb to
facc038Compare`TokenStream` is currently recursive in *two* ways: - the `TokenTree` variant contains a `ThinTokenStream`, which can contain a `TokenStream`; - the `TokenStream` variant contains a `Vec<TokenStream>`. The latter is not necessary and causes significant complexity. This commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`. This reduces complexity significantly. In particular, `StreamCursor` is eliminated, and `Cursor` becomes much simpler, consisting now of just a `TokenStream` and an index. The commit also removes the `Extend` impl for `TokenStream`, because it is only used in tests. (The commit also removes those tests.) Overall, the commit reduces the number of lines of code by almost 200.
facc038 to
e80a930Comparennethercote
commented
Jan 8, 2019
New code is ready for review. r? @eddyb |
petrochenkov
commented
Jan 8, 2019
(eddyb is absent, reassigning to me.) |
petrochenkov
commented
Jan 8, 2019
A bit of a history:
|
petrochenkov
commented
Jan 8, 2019
@bors try |
bors
commented
Jan 8, 2019
Make `TokenStream` less recursive. `TokenStream` is currently recursive in *two* ways: - the `TokenTree` variant contains a `ThinTokenStream`, which can contain a `TokenStream`; - the `TokenStream` variant contains a `Vec<TokenStream>`. The latter is not necessary and causes significant complexity. This commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`. This reduces complexity significantly. In particular, `StreamCursor` is eliminated, and `Cursor` becomes much simpler, consisting now of just a `TokenStream` and an index. The commit also removes the `Extend` impl for `TokenStream`, because it is only used in tests. (The commit also removes those tests.) Overall, the commit reduces the number of lines of code by almost 200.
bors
commented
Jan 8, 2019
☀️ Test successful - status-travis |
petrochenkov
commented
Jan 8, 2019
@rust-timer build 7346647 |
rust-timer
commented
Jan 8, 2019
Insufficient permissions to issue commands to rust-timer. |
emilyalbini
commented
Jan 8, 2019
@rust-timer build 7346647 |
rust-timer
commented
Jan 8, 2019
Success: Queued 7346647 with parent 7ad470c, comparison URL. |
rust-timer
commented
Jan 8, 2019
Finished benchmarking try commit 7346647 |
nnethercote
commented
Jan 8, 2019
The performance results are basically a wash: some minor improvements, some minor regressions. (Which matches what I saw locally.) But note that the regressions are almost entirely within the short-running (and less interesting) benchmarks: |
petrochenkov
commented
Jan 8, 2019
bors
commented
Jan 8, 2019
📌 Commit e80a930 has been approved by |
bors
commented
Jan 9, 2019
Make `TokenStream` less recursive. `TokenStream` is currently recursive in *two* ways: - the `TokenTree` variant contains a `ThinTokenStream`, which can contain a `TokenStream`; - the `TokenStream` variant contains a `Vec<TokenStream>`. The latter is not necessary and causes significant complexity. This commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`. This reduces complexity significantly. In particular, `StreamCursor` is eliminated, and `Cursor` becomes much simpler, consisting now of just a `TokenStream` and an index. The commit also removes the `Extend` impl for `TokenStream`, because it is only used in tests. (The commit also removes those tests.) Overall, the commit reduces the number of lines of code by almost 200.
bors
commented
Jan 9, 2019
💥 Test timed out |
bors
commented
Jan 10, 2019
⌛ Testing commit e80a930 with merge 8090a9c09bf365105ef844d61a2d69124e2c56fa... |
bors
commented
Jan 10, 2019
💔 Test failed - status-appveyor |
nnethercote
commented
Jan 10, 2019
No idea about that, but it seems spurious, so... @bors retry |
bors
commented
Jan 10, 2019
⌛ Testing commit e80a930 with merge 7062e23180480c2f15a1f27a6d444b76b0419bd9... |
bors
commented
Jan 10, 2019
💔 Test failed - status-appveyor |
emilyalbini
commented
Jan 10, 2019
@bors retry |
…rochenkov Make `TokenStream` less recursive. `TokenStream` is currently recursive in *two* ways: - the `TokenTree` variant contains a `ThinTokenStream`, which can contain a `TokenStream`; - the `TokenStream` variant contains a `Vec<TokenStream>`. The latter is not necessary and causes significant complexity. This commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`. This reduces complexity significantly. In particular, `StreamCursor` is eliminated, and `Cursor` becomes much simpler, consisting now of just a `TokenStream` and an index. The commit also removes the `Extend` impl for `TokenStream`, because it is only used in tests. (The commit also removes those tests.) Overall, the commit reduces the number of lines of code by almost 200.
Rollup of 4 pull requests Successful merges: - #57004 (Make `TokenStream` less recursive.) - #57102 (NLL: Add union justifications to conflicting borrows.) - #57337 (rustc: Place wasm linker args first instead of last) - #57549 (Add #[must_use] message to Iterator and Future) Failed merges: r? @ghost
TokenStreamis currently recursive in two ways:the
TokenTreevariant contains aThinTokenStream, which cancontain a
TokenStream;the
TokenStreamvariant contains aVec<TokenStream>.The latter is not necessary and causes significant complexity. This
commit replaces it with the simpler
Vec<(TokenTree, IsJoint)>.This reduces complexity significantly. In particular,
StreamCursoriseliminated, and
Cursorbecomes much simpler, consisting now of just aTokenStreamand an index.The commit also removes the
Extendimpl forTokenStream, because itis only used in tests. (The commit also removes those tests.)
Overall, the commit reduces the number of lines of code by almost 200.