-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix error recovery in format macro parsing #88835
Conversation
It seems that |
Thanks! |
📌 Commit a8421ca has been approved by |
⌛ Testing commit a8421ca with merge 43cb20b43f165d2be40c99326f383feffd2eea94... |
💔 Test failed - checks-actions |
Looks like some infra issue. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a0648ea): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Fixes #88770. Basically, the assumption in the following comment is incorrect:
rust/compiler/rustc_builtin_macros/src/format.rs
Lines 167 to 172 in b69fe57
This is only true in the first iteration of the loop, when
p.clear_expected_tokens()
is called. In subsequent iterations,p.expected_tokens
won't be empty, sop.expect()
won't actually callunexpected_try_recover()
:rust/compiler/rustc_parse/src/parser/mod.rs
Lines 487 to 498 in b69fe57
Instead, it will call
expect_one_of()
, which can recover and returnOk()
. This PR handles this case to fix the ICE in #88770.