-
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
New lint: same_name_method
#7653
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
11f6fb7
to
c81cd9a
Compare
adceb5f
to
9e3ff2a
Compare
Apart from making this a |
Thx! I have removed the todos. |
What's your take on restriction vs. pedantic? Why would you not be satisfied with the former? |
I have no deep insight into the category of lint. Please help we with this hard decision ! |
The idea behind As I don't see how your lints could have false positives, yet depending on the context people may choose to ignore it, this fits the |
I agree on |
r=me with the changed lint category 👍 |
9e3ff2a
to
72b133c
Compare
72b133c
to
e2cdaec
Compare
Thank you @lengyijun ! @bors r+ |
📌 Commit e2cdaec has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
I'm not sure this is the correct place to comment, as it's already closed, but I feel as if this lint shouldn't trigger if the Example: trait T {
fn do(&self, a: u32, b: u32);
}
struct A;
impl A {
fn do(&self, a: u32) { ... }
}
impl T for A {
fn do(&self, a: u32, _b: u32) { Self::do(self, a) }
} |
changelog:
[`same_name_method`]
fix: #7632
It only compares a method in
impl
with another inimpl trait for
It doesn't lint two methods in two traits.
I'm not sure my approach is the best way. I meet difficulty in other approaches.