-
Notifications
You must be signed in to change notification settings - Fork 1.7k
implicit_return
improvements
#6951
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
11916da
to
ffa25ec
Compare
☔ The latest upstream changes (presumably #6971) made this pull request unmergeable. Please resolve the merge conflicts. |
ffa25ec
to
edb76df
Compare
Sorry for taking so long with my reviews recently... Is there any chance you can split this PR in multiple commits? |
edb76df
to
267834e
Compare
Ended up doing a bit of a rewrite at the same time. The code would be simpler to add a return to the top level expression rather to each individual sub expression (e.g. conditionals get a return added to each branch), but that would change the behaviour of the lint. |
267834e
to
f6e7a5a
Compare
☔ The latest upstream changes (presumably #6931) made this pull request unmergeable. Please resolve the merge conflicts. |
f6e7a5a
to
88dc123
Compare
☔ The latest upstream changes (presumably #7043) made this pull request unmergeable. Please resolve the merge conflicts. |
88dc123
to
6d6f933
Compare
☔ The latest upstream changes (presumably #7046) made this pull request unmergeable. Please resolve the merge conflicts. |
6d6f933
to
a7ddaf6
Compare
☔ The latest upstream changes (presumably #7047) made this pull request unmergeable. Please resolve the merge conflicts. |
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! This LGTM overall. I still have to double check the lint_implicit_returns
function, because I only skimmed it in this review round. I only found two documentation/style NITs.
You don't have to keep rebasing your branch. Best thing to do here is to just add commits and rebase/squash it once before merge. It's easier for me to review and you don't have to resolve conflicts every other day. |
@Jarcho I'd still like to see this change: #6951 (comment) Otherwise this LGTM. |
Looks like I forgot to change that. |
Better suggestions when returning macro calls. Suggest changeing all the break expressions in a loop, not just the final statement. Don't lint divergent functions. Don't suggest returning the result of any divergent fuction.
7154e32
to
3d793f3
Compare
@bors r+ Thanks! |
📌 Commit 3d793f3 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes: #6940
changelog: Fix
implicit_return
suggestion for async functionschangelog: Improve
implicit_return
suggestions when returning the result of a macrochangelog: Check for
break
expressions inside a loop which are then implicitly returnedchangelog: Allow all diverging functions in
implicit_return
, not just panic functions