-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[[infinite_loop] fix infinite loop false positive #15157
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
Conversation
c6af9da
to
5e3812b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not too late to do the change, I just noticed I had this unsent review pending in GitHub. Otherwise, I'll submit a cleanup PR.
LOL. It always gets me that comments are invisible until you finish the review. |
Thanks @odysa @samueltardieu |
} | ||
|
||
fn await_async_block() { | ||
// This SHOULD trigger the lint because the async block is awaited |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was meant to be:
This should NOT trigger the lint because the async block is not awaited
changelog: [infinite_loop]: Improve handling of infinite loops in async blocks
Fix #14000
This PR refines the [infinite_loop] lint to avoid false positives when infinite loops occur inside async blocks that are not awaited (such as those that are spawned or assigned to variables for later use). The lint will now only trigger when the async block containing the loop is directly awaited.