-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Added the [unnecessary_box_returns]
lint
#9102
Conversation
r? @dswij (rust-highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #9105) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks for the PR! Sorry I haven't been able to take a look at this. I will get to it asap this week when I have the time |
☔ The latest upstream changes (presumably #9103) 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 for the PR and the patience! The lint logic itself looks great. For the naming, I think unnecessary_box_returns
is slightly more descriptive. What do you think?
I'm actually curious whether this will fire a lot in other rust codebases. I will try to run this lint for some of the most popular crates.
@dswij I like |
Hey, happy that you asked about the name and the suggestion. I would keep the 's' at the end of the name. Rustc's lint naming conventions suggest that lint names should be plural if possible. This also works better with lint attributes affecting multiple cases, like |
@xFrednet Ah, ok. I'll make that change then |
The lint itself is fine, but it requires placement syntax before it's generally applicable. As far as I know that's completely stalled as of now. As a |
[unused_box]
lint[unnecessary_box_returns]
lint
☔ The latest upstream changes (presumably #9243) made this pull request unmergeable. Please resolve the merge conflicts. |
@botahamec I think we can add this to the test case, and I think it's good to be merged once the merge conflict is addressed. |
So, I ran this lint on 250 crates: SummaryBuild failuresTotal: 1
WarningsTotal: 17
There are some improvements that needs to be made. e.g. these suggestion aren't the most accurate.
We can address this in this PR or later as an improvement since this lint is going into |
@dswij I think it at least makes sense to take a look at the third one. I'd honestly be ok with merging on the first two examples. Let me know if there's anything else I should look at though. I don't have my desktop with me at the moment, so it might take a while. |
No rush. Feel free to ping me when it's ready |
4a2a27d
to
59a3ccd
Compare
☔ The latest upstream changes (presumably #9264) made this pull request unmergeable. Please resolve the merge conflicts. |
Note that the first two examples would be caught back by |
hey @botahamec, sorry to nag, but it seems like there's not a lot of activity on this PR lately. Let me know if you don't have much time, and I might be able to continue the work on this PR. |
@dswij Oh yeah, feel free. |
r? @xFrednet I've rebased this and update some outdated stuff. This should be ready to go, any improvements can be in future PRs since this is going to nursery. Would you mind to help take a look if you have the time? |
☔ The latest upstream changes (presumably #10362) made this pull request unmergeable. Please resolve the merge conflicts. |
Hey @botahamec, since you pushed since my last review, have you seen the comments I left? Besides those two I think this is ready for merge :). Your welcome to reach out if you need help with the rebases or have any other questions :) |
@xFrednet Yeah. I was hoping to get it done last week, but I never got around to it. I don't have my computer this week, so hopefully I'll finish it next week. |
Alright, no worries, just wanted to make sure you're not stuck on anything :). Enjoy your week! |
2e65e4a
to
4d50aaa
Compare
Alright. I'm done squashing. That was surprisingly convoluted, but it's down to just four commits now. |
This version looks good to me. Thank you for sticking with this PR and completing it, I highly appreciate it. The squash also looks perfect. I hope you had fun :) @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes #5
I'm not confident in the name of this lint. Let me know if you can think of something better
changelog: New lint:
[`unnecessary_box_returns`]
#9102