Skip to content

macros: fix partially consumed tokens in macro matchers - #37208

Merged
bors merged 2 commits into
rust-lang:masterfrom
jseyfried:fix_partially_consumed_tokens_in_macros
Oct 19, 2016
Merged

macros: fix partially consumed tokens in macro matchers#37208
bors merged 2 commits into
rust-lang:masterfrom
jseyfried:fix_partially_consumed_tokens_in_macros

Conversation

@jseyfried

@jseyfriedjseyfried commented Oct 16, 2016

Copy link
Copy Markdown
Contributor

Fixes#37175.

This PR also avoids re-transcribing the tokens consumed by a matcher (and cloning the TtReader once per matcher), which improves expansion performance of the test case from #34630 by ~8%.

r? @nrc

Comment threadsrc/libsyntax/ext/tt/macro_parser.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this panic should be unreachable (it might be better though to encapsulate this on the token tree somewhere, rather than doing it here.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to unreachable!().

@nrc

nrc commented Oct 17, 2016

Copy link
Copy Markdown
Member

r+ with the nit addressed

@jseyfried
jseyfriedforce-pushed the fix_partially_consumed_tokens_in_macros branch from 71d4d24 to 95a9e2aCompareOctober 17, 2016 23:01
@jseyfried

Copy link
Copy Markdown
ContributorAuthor

@bors r=nrc

@bors

bors commented Oct 17, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 95a9e2a has been approved by nrc

@eddybeddyb mentioned this pull request Oct 18, 2016
eddyb added a commit to eddyb/rust that referenced this pull request Oct 19, 2016
…kens_in_macros, r=nrc
macros: fix partially consumed tokens in macro matchers
Fixesrust-lang#37175.
This PR also avoids re-transcribing the tokens consumed by a matcher (and cloning the `TtReader` once per matcher), which improves expansion performance of the test case from rust-lang#34630 by ~8%.
r? @nrc
eddyb added a commit to eddyb/rust that referenced this pull request Oct 19, 2016
…kens_in_macros, r=nrc
macros: fix partially consumed tokens in macro matchers
Fixesrust-lang#37175.
This PR also avoids re-transcribing the tokens consumed by a matcher (and cloning the `TtReader` once per matcher), which improves expansion performance of the test case from rust-lang#34630 by ~8%.
r? @nrc
@eddybeddyb mentioned this pull request Oct 19, 2016
bors added a commit that referenced this pull request Oct 19, 2016
@bors
bors merged commit 95a9e2a into rust-lang:masterOct 19, 2016
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jseyfried@nrc@bors