Skip to content

[EXPERIMENT] Panic when the pretty-print/reparse check fails #79996

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from

Conversation

Aaron1011
Copy link
Member

r? @ghost

@Aaron1011
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Dec 13, 2020

⌛ Trying commit 3029f8d7bf072ae8ac696ddb2e7d01c45883beb9 with merge 96712b9a8abbabb8c63280714e8aa1379bc76ea9...

If we try to capture the `Vec<u8>` in `Option<Vec<u8>>`, we'll
need to capture a `>` token which was 'unglued' from a `>>` token.
The processing of unglueing a token for parsing purposes bypasses the
usual capturing infrastructure, so we currently lose the trailing `>`.
As a result, we fall back to the reparsed `TokenStream`, causing us to
lose spans.

This commit makes token capturing keep track of a trailing 'unglued'
token. Note that we don't need to care about unglueing except at the end
of the captured tokens - if we capture both the first and second unglued
tokens, then we'll end up capturing the full 'glued' token, which
already works correctly.
Opening for a Crater run. Most of the failures will probably be due to
minor pretty-printer inconsistencies, but we might find some token
collection bugs.
@camelid camelid added the S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. label Dec 18, 2020
@bors
Copy link
Collaborator

bors commented Dec 30, 2020

☔ The latest upstream changes (presumably #79472) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 30, 2020
@Aaron1011
Copy link
Member Author

The check was removed in #79472, so there's no longer any real need for this.

@Aaron1011 Aaron1011 closed this Jan 3, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants