changelog: [min_ident_chars]: don't lint const generics

This commit is contained in:
Milo Moisson 2023-07-24 14:54:55 +02:00
parent 43577d58f9
commit 82982133a9
No known key found for this signature in database
GPG Key ID: 7EA9B7563C01CA5E
2 changed files with 12 additions and 0 deletions

View File

@ -129,6 +129,14 @@ fn visit_id(&mut self, hir_id: HirId) {
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;
}

View File

@ -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]);
}