]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/replace_consts.rs
Merge branch 'macro-use' into HEAD
[rust.git] / clippy_lints / src / replace_consts.rs
index d6d9125a49ca4bff1670f5e2806d946dd215e2f5..b9a4c6ebb1958d5927bcc4e73920a1b85e920d2b 100644 (file)
@@ -1,4 +1,6 @@
 use rustc::lint::*;
+use rustc::{declare_lint, lint_array};
+use if_chain::if_chain;
 use rustc::hir;
 use rustc::hir::def::Def;
 use crate::utils::{match_def_path, span_lint_and_sugg};
@@ -37,7 +39,7 @@ fn get_lints(&self) -> LintArray {
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ReplaceConsts {
     fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
         if_chain! {
-            if let hir::ExprPath(ref qp) = expr.node;
+            if let hir::ExprKind::Path(ref qp) = expr.node;
             if let Def::Const(def_id) = cx.tables.qpath_def(qp, expr.hir_id);
             then {
                 for &(const_path, repl_snip) in REPLACEMENTS {