Recover on attribute in use tree#155254
Open
scrabsha wants to merge 2 commits intorust-lang:mainfrom
Open
Conversation
This comment has been minimized.
This comment has been minimized.
291ff75 to
290c04c
Compare
fmease
reviewed
Apr 13, 2026
290c04c to
83f6ae9
Compare
Contributor
Author
|
@fmease would you be ok with me assigning this PR to you? (once I have re-reviewed it again) |
Member
|
Sure! :) |
83f6ae9 to
0e53906
Compare
scrabsha
commented
Apr 17, 2026
Comment on lines
+1421
to
+1423
| .filter_map(|segment| { | ||
| if !segment.ident.is_special() { Some(segment.ident.as_str()) } else { None } | ||
| }) |
Contributor
Author
There was a problem hiding this comment.
This filter_map removes any segment that is a special identifier - not just the leading {{root}}. I cannot think of a case in which it is an issue, but I want to mention it regardless.
scrabsha
commented
Apr 17, 2026
Contributor
Author
There was a problem hiding this comment.
The changes in the file are needed because the closure passed to span_extend_while in item.rs mutably borrows comma_reached.
Contributor
Author
|
thank you! r? fmease |
Collaborator
|
Requested reviewer is already assigned to this pull request. Please choose another assignee. |
Collaborator
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease |
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.
Renders as:

This requires passing two more arguments to
Parser::parse_use_treeand I'm not super happy about it. I did consider adding more context toParserinstead, but that did not sound like a good idea. Happy to rework my code to make it less ugly :)I am also not very happy that the deletion shows up as a green
~in the suggestion. I tried very hard to make it render properly but failed. I am not sure it's actually possible but would love to be proven wrong hehe