Skip to content

Commit 191a901

Browse files
committed
consider array initializer for large_stack_arrays
1 parent 435a8ad commit 191a901

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/large_stack_arrays.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl_lint_pass!(LargeStackArrays => [LARGE_STACK_ARRAYS]);
3838

3939
impl<'tcx> LateLintPass<'tcx> for LargeStackArrays {
4040
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
41-
if let ExprKind::Repeat(_, _) = expr.kind
41+
if let ExprKind::Repeat(_, _) | ExprKind::Array(_) = expr.kind
4242
&& let ty::Array(element_type, cst) = cx.typeck_results().expr_ty(expr).kind()
4343
&& let ConstKind::Value(ty::ValTree::Leaf(element_count)) = cst.kind()
4444
&& let Ok(element_count) = element_count.try_to_target_usize(cx.tcx)

0 commit comments

Comments
 (0)