[EXPERIMENT] Panic when the pretty-print/reparse check fails #79996
Closed
Aaron1011 wants to merge 2 commits intorust-lang:masterfrom
Closed
[EXPERIMENT] Panic when the pretty-print/reparse check fails #79996Aaron1011 wants to merge 2 commits intorust-lang:masterfrom
Aaron1011 wants to merge 2 commits intorust-lang:masterfrom
Conversation
Contributor
Author
|
@bors try |
Collaborator
|
⌛ 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.
3029f8d to
2e29575
Compare
Collaborator
|
☔ The latest upstream changes (presumably #79472) made this pull request unmergeable. Please resolve the merge conflicts. |
Contributor
Author
|
The check was removed in #79472, so there's no longer any real need for this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? @ghost