-
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
Rework use_self impl based on ty::Ty comparison #3410 | Take 2 #6179
Conversation
r? @ebroto (rust_highfive has picked a reviewer for you, use r? to override) |
f074beb
to
1120e2b
Compare
1120e2b
to
08280f6
Compare
Sorry I still have not reviewed this. It's on my radar but it's quite long and TBH it was sitting there for some time already :) I'm giving priority to some PRs by new contributors and smaller ones, I expect I'll be able to get to this soonish. |
Don't worry, I'm also low on time and also prioritize reviewing over implementing things, if I got a bit of time. |
☔ The latest upstream changes (presumably #6338) 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 tried to rebase this but I'm not familiar enough with the changes. |
Oh this is still open 😄 I try to rebase it tomorrow. |
b79663c
to
8886128
Compare
@ebroto I rebased it successfully. It was indeed quite a bit of work. The only remaining issue is #4140. I added it to the known problems section. I think we should merge it like this, since I don't think I will get to it in the near future and it improves the situation of this lint immensely. Not sure if we should move the lint out of nursery now. WDYT? |
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.
I just found some small stuff
The work done here is extraordinary, but besides #4140, #3881 #3909 #4887 are still relevant. Since we know the lint has still FPs, I would not move it from the nursery for now.
That said, the issues besides #4140 would be fixed by avoiding macros altogether and IMO we should go that way, as there's little benefit in linting local macros in this case. After that, just one known FP would remain.
Let me known what you think.
☔ The latest upstream changes (presumably #6584) made this pull request unmergeable. Please resolve the merge conflicts. |
I like that bors is reminding me about this every now and then. |
r? @phansch (I'm leaving the team, so I'm reassigning my PRs to other active members) |
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.
I can only agree with ebroto
here: 'The work done here is extraordinary'. I just have some documentation nits. Let me know if you need any help with macro testing 🙂
@bors try |
Rework use_self impl based on ty::Ty comparison #3410 | Take 2 This builds on top of #5531 I already reviewed and approved the commits by `@montrivo.` So only the review of my commits should be necessary. I would also appreciate your review `@montrivo,` since you are familiar with the challenges here. Fixes #3410 and Fixes #4143 (same problem) Fixes #2843 Fixes #3859 Fixes #4734 and fixes #6221 Fixes #4305 Fixes #5078 (even at expression level now 🎉) Fixes #3881 and Fixes #4887 (same problem) Fixes #3909 Not yet: #4140 (test added) All the credit for the fixes goes to `@montrivo.` I only refactored and copy and pasted his code. changelog: rewrite [`use_self`] lint and fix multiple (8) FPs. One to go.
☀️ Try build successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This passes now! Thanks @camsteffen! A second pair of eyes on this really helped. Did you manage to produce a minimal reproducer for the ICE? |
Glad I could help! No, sadly I could not reproduce the ICE without testing against |
LGTM! I think it would be nice to have a reproducer for the ICE, but then again, this fixes a lot of other issues with the lint. Let's get this in for now =) @bors r+ |
📌 Commit 52f98d8 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
I kind of expect that this still causes ICEs in some weird cases. We'll see with the next sync in 2 weeks... |
Many thanks for the great work here! ❤️ |
@flip1995 Yeah I'm not quite 100% confident either. In particular, the logic that prevents
@Y-Nak Nice! Want to open a PR with that?
Yep that is also what I decided. |
@camsteffen Yeah! I'll open a PR tomorrow. |
Agreed. But I'm pretty sure I tried to just gate if we're in a body and it failed. I think the reason was, that arguments of closures/functions are in a body from the AST perspective, but not really in a body from the typeck perspective. |
Hmm. How about something like this?
|
...or invert it and call it Edit: No I take that back. Consider a type annotation on a |
I mean, we could try. I just know, that I didn't find a reliable way to differentiate between the part of the body we're currently in. Well, the |
This builds on top of #5531
I already reviewed and approved the commits by @montrivo. So only the review of my commits should be necessary.
I would also appreciate your review @montrivo, since you are familiar with the challenges here.
Fixes #3410 and Fixes #4143 (same problem)
Fixes #2843
Fixes #3859
Fixes #4734 and fixes #6221
Fixes #4305
Fixes #5078 (even at expression level now 🎉)
Fixes #3881 and Fixes #4887 (same problem)
Fixes #3909
Not yet: #4140 (test added)
All the credit for the fixes goes to @montrivo. I only refactored and copy and pasted his code.
changelog: rewrite [
use_self
] lint and fix multiple (8) FPs. One to go.