Open
Conversation
Summary -- While reviewing #23473, I noticed that the `while` loops in our deferred checks for `for` loops and lambdas would only be used if we pushed additional deferred scopes to the `Checker` while running lint rule code. This should actually be impossible given that the rules only receive a `&Checker` (as shown by the immutable re-borrow), and none of our tests fail when removing the loops. I guess it doesn't hurt to have the loops either since they only run once, but it did serve to confuse me today. I assume, but didn't fully confirm, that this used to be interleaved with the visiting phase, at which point additional deferred scopes could have still been added in the middle of this. Test Plan -- Existing tests
|
amyreese
approved these changes
Feb 27, 2026
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
While reviewing #23473, I noticed that the
whileloops in our deferred checksfor
forloops and lambdas would only be used if we pushed additional deferredscopes to the
Checkerwhile running lint rule code. This should actually beimpossible given that the rules only receive a
&Checker(as shown by theimmutable re-borrow), and none of our tests fail when removing the loops.
I guess it doesn't hurt to have the loops either since they only run once, but
it did serve to confuse me today.
I assume, but didn't fully confirm, that this used to be interleaved with the
visiting phase, at which point additional deferred scopes could have still been
added in the middle of this.
Test Plan
Existing tests