Skip to content

Commit 867e0ec

Browse files
committed
Auto merge of rust-lang#11218 - MrNossiom:master, r=Manishearth
changelog: [`min_ident_chars`]: don't lint const generics Fixes: rust-lang#11163 changelog: [`min_ident_chars`]: don't lint const generics
2 parents 31f3769 + 8298213 commit 867e0ec

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

clippy_lints/src/min_ident_chars.rs

+8
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

+4
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)