use crate::utils::{
- in_macro, match_def_path, match_qpath, paths, snippet, snippet_with_applicability, span_help_and_lint,
+ in_macro, match_def_path, match_qpath, paths, snippet, snippet_with_applicability, span_lint_and_help,
span_lint_and_sugg, span_lint_and_then,
};
use if_chain::if_chain;
-use rustc::declare_lint_pass;
-use rustc::hir::{BorrowKind, Expr, ExprKind, Mutability, QPath};
-use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass};
+use rustc::lint::in_external_macro;
use rustc_errors::Applicability;
-use rustc_session::declare_tool_lint;
+use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, QPath};
+use rustc_lint::{LateContext, LateLintPass};
+use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
declare_clippy_lint! {
if let Some(repl_def_id) = cx.tables.qpath_res(repl_func_qpath, repl_func.hir_id).opt_def_id();
then {
if match_def_path(cx, repl_def_id, &paths::MEM_UNINITIALIZED) {
- span_help_and_lint(
+ span_lint_and_help(
cx,
MEM_REPLACE_WITH_UNINIT,
expr_span,
);
} else if match_def_path(cx, repl_def_id, &paths::MEM_ZEROED) &&
!cx.tables.expr_ty(src).is_primitive() {
- span_help_and_lint(
+ span_lint_and_help(
cx,
MEM_REPLACE_WITH_UNINIT,
expr_span,