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:
bors 2023-07-24 21:26:56 +00:00
commit 867e0ec024
2 changed files with 12 additions and 0 deletions

View file

@ -129,6 +129,14 @@ impl Visitor<'_> for IdentVisitor<'_, '_> {
return; 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) { if is_from_proc_macro(cx, &ident) {
return; return;
} }

View file

@ -81,3 +81,7 @@ fn b() {}
fn wrong_pythagoras(a: f32, b: f32) -> f32 { fn wrong_pythagoras(a: f32, b: f32) -> f32 {
a * a + a * b a * a + a * b
} }
mod issue_11163 {
struct Array<T, const N: usize>([T; N]);
}