-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Parse ident with allowing recovery when trying to diagnose #151249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+102
−22
Conversation
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
This comment was marked as outdated.
This comment was marked as outdated.
parameter_without_type
This comment has been minimized.
This comment has been minimized.
parameter_without_type
estebank
reviewed
Jan 19, 2026
Contributor
|
The recovered diagnostics sadly look a bit wonky, but still better than an ICE :( |
Contributor
|
@bors r+ |
Contributor
rust-bors bot
pushed a commit
that referenced
this pull request
Jan 19, 2026
…uwer Rollup of 15 pull requests Successful merges: - #148623 (Ignore `#[doc(hidden)]` items when computing trimmed paths for printing) - #150550 (Miscellaneous cleanups to borrowck related code) - #150879 (Remove the diagnostic lints) - #150895 (rustc_errors: Add (heuristic) Syntax Highlighting for `rustc --explain`) - #150987 (remote-test-server: Fix header in batch mode) - #151004 (std: implement `sleep_until` on Apple platforms) - #151045 (Simplify some literal-value negations with `u128::wrapping_neg`) - #151119 (Support pointers in type reflection) - #151171 (Do not recover from `Trait()` if generic list is unterminated) - #151231 (HIR typeck cleanup: clarify and re-style `check_expr_unop`) - #151249 (Parse ident with allowing recovery when trying to diagnose) - #151295 (THIR patterns: Use `ty::Value` in more places throughout `const_to_pat`) - #151326 (Remove `DiagMessage::Translated` in favour of `DiagMessage::Str`) - #151361 (add test for issue 61463) - #151371 (Add `S-blocked` to `labels_blocking_approval`) r? @ghost
rust-timer
added a commit
that referenced
this pull request
Jan 20, 2026
Rollup merge of #151249 - fix/151238, r=petrochenkov Parse ident with allowing recovery when trying to diagnose Fixes #151238 #146978 made parsing ident not always allowed-recovery ([change](https://github.com/rust-lang/rust/pull/146978/changes#diff-ef8d6186dc7fb1d03a71446d0c9e6cc9e72158ec6896703dcf05686ee7dc83fcL469-R469)), so when matching macro with `NoopTracker`, which has `Recovery::Forbidden`, ICE happens when trying to parse kw as ident and then unwraping it. This PR introduces a new method for parsing ident with allowing recovery when trying to diagnose. Then errors will behave like previous. r? @petrochenkov
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jan 20, 2026
…uwer Rollup of 15 pull requests Successful merges: - rust-lang/rust#148623 (Ignore `#[doc(hidden)]` items when computing trimmed paths for printing) - rust-lang/rust#150550 (Miscellaneous cleanups to borrowck related code) - rust-lang/rust#150879 (Remove the diagnostic lints) - rust-lang/rust#150895 (rustc_errors: Add (heuristic) Syntax Highlighting for `rustc --explain`) - rust-lang/rust#150987 (remote-test-server: Fix header in batch mode) - rust-lang/rust#151004 (std: implement `sleep_until` on Apple platforms) - rust-lang/rust#151045 (Simplify some literal-value negations with `u128::wrapping_neg`) - rust-lang/rust#151119 (Support pointers in type reflection) - rust-lang/rust#151171 (Do not recover from `Trait()` if generic list is unterminated) - rust-lang/rust#151231 (HIR typeck cleanup: clarify and re-style `check_expr_unop`) - rust-lang/rust#151249 (Parse ident with allowing recovery when trying to diagnose) - rust-lang/rust#151295 (THIR patterns: Use `ty::Value` in more places throughout `const_to_pat`) - rust-lang/rust#151326 (Remove `DiagMessage::Translated` in favour of `DiagMessage::Str`) - rust-lang/rust#151361 (add test for issue 61463) - rust-lang/rust#151371 (Add `S-blocked` to `labels_blocking_approval`) r? @ghost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Fixes #151238
#146978 made parsing ident not always allowed-recovery (change), so when matching macro with
NoopTracker, which hasRecovery::Forbidden, ICE happens when trying to parse kw as ident and then unwraping it.This PR introduces a new method for parsing ident with allowing recovery when trying to diagnose. Then errors will behave like previous.
r? @petrochenkov