Skip to content

Commit 8298213

Browse files
committed
changelog: [min_ident_chars]: don't lint const generics
1 parent 43577d5 commit 8298213

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

clippy_lints/src/min_ident_chars.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ impl Visitor<'_> for IdentVisitor<'_, '_> {
129129
return;
130130
}
131131

132+
// `struct Array<T, const N: usize>([T; N])`
133+
// ^
134+
if let Node::GenericParam(generic_param) = node
135+
&& let GenericParamKind::Const { .. } = generic_param.kind
136+
{
137+
return;
138+
}
139+
132140
if is_from_proc_macro(cx, &ident) {
133141
return;
134142
}

tests/ui/min_ident_chars.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ fn b() {}
8181
fn wrong_pythagoras(a: f32, b: f32) -> f32 {
8282
a * a + a * b
8383
}
84+
85+
mod issue_11163 {
86+
struct Array<T, const N: usize>([T; N]);
87+
}

0 commit comments

Comments
 (0)