-
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
Add lint for maps with zero-sized value types #6218
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
☔ The latest upstream changes (presumably #6109) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
I'm in the middle of a move and may cut back on reviewing for a few weeks. I'm going to reassign my PRs for now, though i'll still try to review smaller things. r? @ebroto |
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 your contribution and sorry for the delay in reviewing, I'm really short on time lately.
I think we can simplify a lot this lint if we move the body of your current check_ty
method to the implementation of LateLintPass' check_ty
, transforming the hir::Ty
into a ty::Ty
with hir_ty_to_ty
as you do currently elsewhere.
We should keep the check you do to avoid linting in trait impls, that is a good idea 👍
In this case, I think it makes sense as there are some intermediary commits. But let's wait until the PR is approved, it's more helpful if the remarks are addressed as follow-up commits. |
This PR currently causes some tests to fail with ICEs. I believe that this is due to the use of Is there any way to turn a HIR
What is your opinion on this? |
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
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.
Indeed, hir_ty_to_ty
seems to choke with inference variables and unnamed lifetimes. To solve this, the proposed solution first would check if there are typecheck results available and use those, otherwise fail back to hir_ty_to_ty
.
Typecheck results are available in bodies, where inferred types are valid, so if there are no results we should not find type inference.
☔ The latest upstream changes (presumably #6333) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
ping from triage @korrat. There seems to be fixes left to be done. Do you have any questions on how to proceed here? |
43f82af
to
4e2bfa2
Compare
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
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.
Just the nit (sorry about that 😄) and your suggestion about the tests, and this should be ready to go!
Thanks for making this move forward.
Thanks for being so quick in reviewing this again and again and sorry for the delay previously. Somehow the notification about your comment ended up in my spam mail folder where I didn't see it until yesterday. @rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
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.
This LGTM now! Thanks for all the effort you've put into this, and don't hesitate to take another issue if you had fun with this one :)
Could you squash your commits before merging? I should have said that in my last review, my apologies.
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
Sure, I squashed the commits. I didn't want to make the review harder for you earlier. |
@bors r+ Thanks! |
📌 Commit f77f1db has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Hi, this is my first time contributing to clippy or rust in general, so I'm not sure about the details of contributing. Please excuse me and let me now if I did anything wrong. I have a couple of questions:
changelog: Add lint for maps with zero-sized value types
Fixes #1641