-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix min_ident_chars
: ignore on trait impl.
#15275
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
base: master
Are you sure you want to change the base?
Conversation
Lintcheck changes for baded8c
This comment will be updated if you push new changes |
For a local trait, it should warn about the short parameter name in the trait method definition. I don't see a test for this, and I suspect it won't warn. To suppress warnings about trait implementations, we should ensure it warns at the trait definition so that users are warned at least once about the usage of short identifiers. |
Yes, I didn't look at that case, and it seems it never fired the lint even before my PR: #![allow(dead_code)]
#![warn(clippy::min_ident_chars)]
trait Trait {
fn func(x: u32) -> u32;
}
struct Struct;
impl Trait for Struct {
fn func(x: u32) -> u32 {
x
}
}
fn main() {} This code doesn't produce any warnings. For functions with one char, it works though, and it warns on trait definition only, so I guess I should do the same thing for one-char-long params |
My previous message wasn't correct, as Strange thing that the CIs stopped passing on an error in the source file, that I didn't change on this commit |
fixes #13396
changelog: [
min_ident_chars
]: ignore lint when implementing a trait, to respect [renamed_function_params
]