]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/eval_order_dependence.rs
Merge branch 'macro-use' into HEAD
[rust.git] / clippy_lints / src / eval_order_dependence.rs
index d2ac597b6c58a65d0fc5c8729c547a1dbecbd989..b0295d2e7d471d0f1cb70028bb572c408bfc6599 100644 (file)
@@ -2,6 +2,8 @@
 use rustc::hir::*;
 use rustc::ty;
 use rustc::lint::*;
+use rustc::{declare_lint, lint_array};
+use if_chain::if_chain;
 use syntax::ast;
 use crate::utils::{get_parent_expr, span_lint, span_note_and_lint};
 
@@ -83,7 +85,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
     fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
         match stmt.node {
             StmtKind::Expr(ref e, _) | StmtKind::Semi(ref e, _) => DivergenceVisitor { cx }.maybe_walk_expr(e),
-            StmtKind::Decl(ref d, _) => if let DeclLocal(ref local) = d.node {
+            StmtKind::Decl(ref d, _) => if let DeclKind::Local(ref local) = d.node {
                 if let Local {
                     init: Some(ref e), ..
                 } = **local
@@ -267,7 +269,7 @@ fn check_stmt<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, stmt: &'tcx Stmt) -> St
             // If the declaration is of a local variable, check its initializer
             // expression if it has one. Otherwise, keep going.
             let local = match decl.node {
-                DeclLocal(ref local) => Some(local),
+                DeclKind::Local(ref local) => Some(local),
                 _ => None,
             };
             local