]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/mem_replace.rs
Auto merge of #4809 - iankronquist:patch-1, r=flip1995
[rust.git] / clippy_lints / src / mem_replace.rs
index d00ee4940d7e9919c5e92d70b9da455caf0e6551..d2b1fd3a9e61fb6e68864941bc227981beb65871 100644 (file)
@@ -1,13 +1,13 @@
 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! {
@@ -142,7 +142,7 @@ fn check_replace_with_uninit(cx: &LateContext<'_, '_>, src: &Expr<'_>, expr_span
             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,
@@ -151,7 +151,7 @@ fn check_replace_with_uninit(cx: &LateContext<'_, '_>, src: &Expr<'_>, 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,