mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
Auto merge of #11218 - MrNossiom:master, r=Manishearth
changelog: [`min_ident_chars`]: don't lint const generics Fixes: #11163 changelog: [`min_ident_chars`]: don't lint const generics
This commit is contained in:
commit
867e0ec024
2 changed files with 12 additions and 0 deletions
|
@ -129,6 +129,14 @@ impl Visitor<'_> for IdentVisitor<'_, '_> {
|
|||
return;
|
||||
}
|
||||
|
||||
// `struct Array<T, const N: usize>([T; N])`
|
||||
// ^
|
||||
if let Node::GenericParam(generic_param) = node
|
||||
&& let GenericParamKind::Const { .. } = generic_param.kind
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if is_from_proc_macro(cx, &ident) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -81,3 +81,7 @@ fn b() {}
|
|||
fn wrong_pythagoras(a: f32, b: f32) -> f32 {
|
||||
a * a + a * b
|
||||
}
|
||||
|
||||
mod issue_11163 {
|
||||
struct Array<T, const N: usize>([T; N]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue