Skip to content

Conversation

lapla-cogito
Copy link
Contributor

fixes #9911

changelog: [blocks_in_conditions]: don't trigger the lint when the condition contains a return

@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2025

r? @Manishearth

rustbot has assigned @Manishearth.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 2, 2025
Copy link
Member

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small refactoring and this looks ok.

Copy link
Member

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I have a nit but it is not blocking. @Manishearth you can queue it if it's ok with you.

}

// Linting should not be triggered to cases where `return` is included in the condition.
// #9911
Copy link
Member

@samueltardieu samueltardieu Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I personally dislike using a issue number here (it is already present in the tests which would fail if this was removed), but there are already a few instances of it (but not many) in the sources. This is different from using "TODO see issue #xxx" because in this case there is an action needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to have context like this noted

@Manishearth Manishearth added this pull request to the merge queue Mar 9, 2025
Merged via the queue into rust-lang:master with commit 1b62885 Mar 9, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

blocks_in_conditions can't deal with return expression in condition
4 participants