-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix collapsible_if
FP on block stmt before expr
#14730
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
Nominating this to be in the same release as #14481 if needed |
Thanks, this was indeed introduced (and not caught by existing checks) during the conversion into a late lint. |
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.
The fix looks complicated. It looks like there is a guard missing in expr_block()
, adding it may be enough to fix the problem and would greatly simplify this PR:
match block.stmts {
[] => block.expr,
- [stmt] => {
+ [stmt] if block.expr.is_none() => {
This comment has been minimized.
This comment has been minimized.
Thanks. Im changing it back now. |
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.
LGTM, thanks
Same as: #14733 (comment) The likelihood of a beta backport right after the release increases. |
Closes #14722
changelog: [
collapsible_if
] fix FP on block stmt before expr