Repository navigation
Conversation
jieyouxu
commented
Oct 17, 2026
|
|
||
| fn main() { | ||
| foo!(1 + 2); | ||
| foo!(1 + 2); |
Member
Author
There was a problem hiding this comment.
NB: this technically changes stable default formatting.
jieyouxu
commented
Oct 17, 2026
Comment on lines
+199
to
+204
| // Indicative of an error count leak elsewhere. | ||
| debug_assert_eq!( | ||
| dcx.err_count(), | ||
| 0, | ||
| "dcx error count should be 0 before calling `try_synthetic_parse`" | ||
| ); |
Member
Author
There was a problem hiding this comment.
Note that this may trigger for other unrelated leaks. I rather leave this debug assert in even if this triggers some debug ICE, as I would like to know if something triggers this.
This branch has not been deployed
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.
Summary
Follow-up to #7171, essentially the same leaking of shared error count state problem.
Fixes #7184.
Formatting stability
I believe this technically impacts stable
cfg_if!formatting, but I consider it acceptable because the previous behavior was just buggy.Notes for the reviewer
parse_expr/parse_lazy_static/rewrite_macrothat I think has similar-ish error count leak bugs. I didn't want to fix them here in the same PR. The helper introduced here could be used (or modified) in follow-ups.cfg_if!stable formatting, don't want to address Reset error counts on synthetic parser constructions #7180 in this PR.cfg_if!fix, commit 3 is the refactor to pull out a shared helper.Used an LLM for co-review only.