Skip to content

Refactor token collection to capture trailing token immediately - #81017

Merged
bors merged 1 commit into
rust-lang:masterfrom
Aaron1011:collect-trailing-token
Jan 23, 2021
Merged

Refactor token collection to capture trailing token immediately#81017
bors merged 1 commit into
rust-lang:masterfrom
Aaron1011:collect-trailing-token

Conversation

@Aaron1011

@Aaron1011Aaron1011 commented Jan 14, 2021

Copy link
Copy Markdown
Contributor

Split out from #80689 - when we start capturing more information about attribute targets, we'll need to know in advance if we're capturing a trailing token or not.

r? @ghost

@Aaron1011Aaron1011 changed the title Set tokens on AST node in collect_tokensRefactor token collection to capture trailing token immediatelyJan 14, 2021
@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@bors

bors commented Jan 14, 2021

Copy link
Copy Markdown
Collaborator

⌛ Trying commit c0d77f1c76c8d324c77755cd99908860d4c3eec0 with merge 125fb95a2bc8697595e30ef058c5cc82b2222284...

@bors

bors commented Jan 14, 2021

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 125fb95a2bc8697595e30ef058c5cc82b2222284 (125fb95a2bc8697595e30ef058c5cc82b2222284)

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued 125fb95a2bc8697595e30ef058c5cc82b2222284 with parent d03fe84, future comparison URL.

@rustbot label: +S-waiting-on-perf

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 14, 2021
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking try commit (125fb95a2bc8697595e30ef058c5cc82b2222284): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 14, 2021
@Aaron1011
Aaron1011force-pushed the collect-trailing-token branch from c0d77f1 to 73a976fCompareJanuary 14, 2021 22:51
@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@bors

bors commented Jan 14, 2021

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 73a976ffd206a284f6485baf7a37545ef6cc6343 with merge df2eeabc93790b4803c40f482839a38c56301e3b...

@rust-log-analyzer

This comment has been minimized.

@petrochenkov

petrochenkov commented Jan 14, 2021

Copy link
Copy Markdown
Contributor

Something like this was my first thought when you introduced the semicolon token collection - "you just need to refactor statement parsing carefully, so the parsed statements already contain semicolons".
Statement parsing is kind of a mess though, and is plagued by ad hoc diagnostic code as well, so it was kind of understandable why adding the add_trailing_semi hack could be less invasive.

The end goal for statement parsing is to use it basically everywhere - for parsing statements not only in blocks, but also in all contexts where items can be written (so e.g. let x = 10; is parsed and gracefully rejected even if written at module level).
Centril started this work in #69366 and related PRs, but didn't finish it unfortunately.
I think we can change (or even slightly break) the behavior of the (almost unused) stmt nonterminal to achieve this goal, if it becomes necessary.

@bors

bors commented Jan 14, 2021

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: df2eeabc93790b4803c40f482839a38c56301e3b (df2eeabc93790b4803c40f482839a38c56301e3b)

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued df2eeabc93790b4803c40f482839a38c56301e3b with parent 4275ef6, future comparison URL.

@rustbot label: +S-waiting-on-perf

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 14, 2021
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking try commit (df2eeabc93790b4803c40f482839a38c56301e3b): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbotrustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 15, 2021
@Aaron1011
Aaron1011force-pushed the collect-trailing-token branch from 73a976f to b8b7901CompareJanuary 15, 2021 19:13
@rust-log-analyzer

This comment has been minimized.

@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@bors

bors commented Jan 15, 2021

Copy link
Copy Markdown
Collaborator

⌛ Trying commit f5acaa1f663e5f0979aad348b2bf1e081c1ef520 with merge 48d68b3b8d788525a0310668dfae564f7edf7e09...

@bors

bors commented Jan 15, 2021

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 48d68b3b8d788525a0310668dfae564f7edf7e09 (48d68b3b8d788525a0310668dfae564f7edf7e09)

@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@petrochenkov: The force_capture changes are needed to avoid exposing the underlying issue in #81007 further. I'll split out the changes first, and then rebase this PR on top of that.

@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

Blocked on #81177.

@Aaron1011Aaron1011 added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Jan 18, 2021
@Aaron1011
Aaron1011force-pushed the collect-trailing-token branch from 5522328 to c901b42CompareJanuary 22, 2021 01:48
@Aaron1011
Aaron1011force-pushed the collect-trailing-token branch from c901b42 to ccfc292CompareJanuary 22, 2021 05:50
@Aaron1011Aaron1011 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 22, 2021
@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@petrochenkov: I've rebased this PR against master. The content is almost the same as before - a small adjustment to maybe_collect_tokens was needed.

@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@bors

bors commented Jan 22, 2021

Copy link
Copy Markdown
Collaborator

⌛ Trying commit ccfc292 with merge 134fdeae99435ada2f12fd43c12f277914f9a9f7...

@bors

bors commented Jan 22, 2021

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 134fdeae99435ada2f12fd43c12f277914f9a9f7 (134fdeae99435ada2f12fd43c12f277914f9a9f7)

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued 134fdeae99435ada2f12fd43c12f277914f9a9f7 with parent dc1eee2, future comparison URL.

@rustbot label: +S-waiting-on-perf

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 22, 2021
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking try commit (134fdeae99435ada2f12fd43c12f277914f9a9f7): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbotrustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 22, 2021
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jan 22, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit ccfc292 has been approved by petrochenkov

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 22, 2021
@bors

bors commented Jan 23, 2021

Copy link
Copy Markdown
Collaborator

⌛ Testing commit ccfc292 with merge 693ed05...

@bors

bors commented Jan 23, 2021

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 693ed05 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Jan 23, 2021
@bors
bors merged commit 693ed05 into rust-lang:masterJan 23, 2021
@rustbotrustbot added this to the 1.51.0 milestone Jan 23, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@Aaron1011@rust-timer@bors@rust-log-analyzer@petrochenkov@rustbot