Skip to content

Commit 7cc8fa2

Browse files
committed
Fix fallout
1 parent 9b4faf9 commit 7cc8fa2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/large_stack_arrays.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc::hir::*;
22
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
33
use rustc::mir::interpret::ConstValue;
4-
use rustc::ty;
4+
use rustc::ty::{self, ConstKind};
55
use rustc::{declare_tool_lint, impl_lint_pass};
66

77
use if_chain::if_chain;
@@ -43,7 +43,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeStackArrays {
4343
if_chain! {
4444
if let ExprKind::Repeat(_, _) = expr.kind;
4545
if let ty::Array(element_type, cst) = cx.tables.expr_ty(expr).kind;
46-
if let ConstValue::Scalar(element_count) = cst.val;
46+
if let ConstKind::Value(val) = cst.val;
47+
if let ConstValue::Scalar(element_count) = val;
4748
if let Ok(element_count) = element_count.to_machine_usize(&cx.tcx);
4849
if let Ok(element_size) = cx.layout_of(element_type).map(|l| l.size.bytes());
4950
if self.maximum_allowed_size < element_count * element_size;

0 commit comments

Comments
 (0)