We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
large_stack_arrays
1 parent 435a8ad commit 191a901Copy full SHA for 191a901
clippy_lints/src/large_stack_arrays.rs
@@ -38,7 +38,7 @@ impl_lint_pass!(LargeStackArrays => [LARGE_STACK_ARRAYS]);
38
39
impl<'tcx> LateLintPass<'tcx> for LargeStackArrays {
40
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
41
- if let ExprKind::Repeat(_, _) = expr.kind
+ if let ExprKind::Repeat(_, _) | ExprKind::Array(_) = expr.kind
42
&& let ty::Array(element_type, cst) = cx.typeck_results().expr_ty(expr).kind()
43
&& let ConstKind::Value(ty::ValTree::Leaf(element_count)) = cst.kind()
44
&& let Ok(element_count) = element_count.try_to_target_usize(cx.tcx)
0 commit comments