-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix false positive on semicolon_if_nothing_returned
#7326
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
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
Please rebase on master. You have a commit in this PR that is already on master. |
Sorry, just rebased moments before the PR, guess it was bad timing... |
semicolon_if_nothing_returned
semicolon_if_nothing_returned
semicolon_if_nothing_returned
Looking at #7322, this PR would favor the |
Alright, I added the changes discussed on Zulip, this PR is now ready for review @flip1995! |
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.
Thanks!
@bors r+ |
📌 Commit 5ec80f3 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
That should be a new pedantic lint. |
rust-lang/rust-clippy#7326 does not seem to be included in the latest Clippy binary.
Currently the
semicolon_if_nothing_returned
lint fires in unwanted situations where a block only spans one line. An example of this was given in #7324. This code:yields the following clippy error:
I updated the lint to check if the statement is inside an
unsafe
block, a closure or a normal block and if the block only spans one line, in that case the lint is not emitted.This closes #7324.
changelog: enhanced semicolon if nothing returned according to #7324.