-
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 check_self_items
setting for needless_pass_by_ref_mut
lint
#12648
Add check_self_items
setting for needless_pass_by_ref_mut
lint
#12648
Conversation
r? @Manishearth rustbot has assigned @Manishearth. Use |
b115ce2
to
dcdd67d
Compare
Assigning someone else as I think they're still busy at the moment. r? @llogiq |
Should fix #9591 too? |
Ah indeed. |
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.
it's unclear to me that a config is actually the solution here. we should first try to better understand the problem space.
Since I have a full plate already and he seems to have the PR well in hand, back to |
For start, you can read linked issues, #9591, #10900 (comment) |
Yes, I'm not convinced that that is a case not better served with targeted For it to be a config I'd need to see a strong reason why this needs to be a codebase-wide decision. |
Targeted |
Ok, but if this lint were to unconditionally lint Basically what is the benefit of a config over making this available all the time? Sure, this lint is in nursery, but why do work we may decide to undo at some point? For the lint to get out of nursery these discussions need to happen at some point, and there's not a huge benefit of waiting on this one. |
It's the other way around: this lint never lints |
Yes, I understand: why does this have to be a config and not unconditional behavior? My comment was talking about that hypothetical and comparing it with this PR. |
Thanks for clarifying. I was able to find my original answer about it here. Basically, you might want to keep |
Yes, why is that use case not adequately satisfied by And I don't think it's concrete enough. |
In short, I was trying to limit the scope of the lint as much as possible. That's the only backing to it. Like I said, we could enable it by default and instead have this config to disable this behaviour. |
Yeah in general config options expand the scope of a lint and need to have a strong reason |
Just to confirm: following your logic, if the config would be to disable the check on |
No. I'm saying having a config in the first place, regardless of what it does, expands the scope of a lint because it's effectively multiple lints now. We should avoid that unless both lints can be justified. I can't see a strong justification for the "no-lint-self" version of this lint. |
Makes sense. Gonna update this lint to check for |
Closing in favor of #12693. |
Fixes #12589.
Fixes #9591.
This adds a
check_self_items
setting to allow theneedless_pass_by_ref_mut
lint to check for&mut self
items.changelog: Add
check_self_items
setting forneedless_pass_by_ref_mut
lint