+use clippy_utils::diagnostics::span_lint_and_help;
+use clippy_utils::source::snippet;
+use if_chain::if_chain;
use rustc_hir::{Expr, ExprKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::mir::interpret::ConstValue;
+use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::ty::{self, ConstKind};
use rustc_session::{declare_tool_lint, impl_lint_pass};
-use if_chain::if_chain;
-
-use crate::rustc_target::abi::LayoutOf;
-use crate::utils::{snippet, span_lint_and_help};
-
declare_clippy_lint! {
- /// **What it does:** Checks for local arrays that may be too large.
- ///
- /// **Why is this bad?** Large local arrays may cause stack overflow.
+ /// ### What it does
+ /// Checks for local arrays that may be too large.
///
- /// **Known problems:** None.
+ /// ### Why is this bad?
+ /// Large local arrays may cause stack overflow.
///
- /// **Example:**
+ /// ### Example
/// ```rust,ignore
/// let a = [0u32; 1_000_000];
/// ```
+ #[clippy::version = "1.41.0"]
pub LARGE_STACK_ARRAYS,
pedantic,
"allocating large arrays on stack may cause stack overflow"