-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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 non_local_definitions
lint to only use a syntactic heuristic
#127117
base: master
Are you sure you want to change the base?
Conversation
r? @WaffleLapkin since you reviewed the original PR |
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 looked over the tests; looks right to me.
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 typo nits
8dec09e
to
92ba962
Compare
☔ The latest upstream changes (presumably #127493) made this pull request unmergeable. Please resolve the merge conflicts. |
This reverts commit 0c0dfb8.
92ba962
to
3100dfa
Compare
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 don't know how to review this. T-lang's proposal looks to me like "let's make the lint incorrect". And I don't see why the lint is useful, if it's incorrect...
r? lang |
cc @rust-lang/lang also posted a followup comment in #126768 (comment) |
Replied with further context and background over in #126768 (comment). |
💭 ...if I asked for lang to review this, and then TC nominated me, does that mean I'm on lang? Is this my punishment for ribbing T-lang one too many times? Am I now the target of my own japes? ...oh no, I'm barely even awake at 9, how am I going to make a meeting at 8? |
Maybe all of that? /s.... but no, seriously that was me just handing back off after answering the lang questions. Looking again, though, I mean to hand it back to compiler, so... r? compiler |
r? diagnostics |
I've tried to review this every day of the past 3 days and each time finished with a bit more knowledge but mostly feeling unhappy with my understanding of it and the exact things we want to lint. I don't think I can reasonably review this without just removing it entirely, and writing it from scratch and hoping I come up with a close enough final result. That said, the diff makes sense and looks like it does what T-lang wants, I'm just not confident in the full behaviour of this lint now, the cases it's missing and the cases it's not missing. I'm not sure my feelings should be blocking it, but I also don't want to pass on the hot potato for long enough until someone feels like it's not important to understand it fully. |
My understanding is that the lint should fire for what TC calls "sneaky inner impl". What I understand from this is that the lint should warn on In particular it should not take into account the perfect type-system definition since T-lang doesn't "feel" like impls that would lint because of the 1-impl rule are "sneaky". I think one could say that an I think it's also clear from unanimous decision from T-lang that they were not looking at a perfect non local @traviscross could you confirm or deny what I just said. Footnotes
|
I can review this if you want, I only reassigned because I figured waffle might want to review this since it was on the original PR 🤷♀️ |
Let's go! r? @BoxyUwU |
This PR reworks the
non_local_definitions
lint to only use a syntactic heuristic, i.e. not use a type-system logic for whenever animpl
is local or not.Instead the new logic wanted by T-lang in #126768 (comment), which is to consider every paths in
Self
andTrait
and to no longer use the type-system inference trick.@rustbot labels +L-non_local_definitions
Fixes #126768