New lint [needless_return_with_question_mark]#11031
Conversation
|
r? @giraffate (rustbot has picked a reviewer for you, use r? to override) |
|
☔ The latest upstream changes (presumably #11061) made this pull request unmergeable. Please resolve the merge conflicts. |
|
I didn't immediately understand |
|
I'm fine with that, |
97e6924 to
77512cd
Compare
giraffate
left a comment
There was a problem hiding this comment.
Overall looks good, thanks! I made some comments.
| /// Ok(()) | ||
| /// } | ||
| /// ``` | ||
| /// if paired with `try_err`, use instead: |
There was a problem hiding this comment.
IMO it would be better to change suggestions by using is_lint_allowed when warning try_err, but it can be done in another pull request.
There was a problem hiding this comment.
We should probably move around try_err then, probably to returns instead of matches, that way we can reuse the logic. But I'm ok with this.
|
Okay. Then can we update the version #11031 (comment) ? |
|
Yeah, but I'll also move |
|
This actually seems too complex to tackle rn, I'll take another look at some point and potentially create a followup PR |
|
@bors r+ Thanks! |
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
needless_return_with_try]needless_return_with_question_mark]
Closes #10902
Rather than having a config option, this will just suggest removing the "return"; if
try_erris used as well, then it'll be added again but without the?.changelog: New lint [
needless_return_with_try]