about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-05-14 15:08:29 +0200
committerflip1995 <hello@philkrones.com>2019-05-14 15:08:29 +0200
commit5dea5d404c389417e960c52ed5f386699a13d904 (patch)
tree253824b75a49eb0ede5f245e9d0e75254a78215e
parent4b4d73475808c1e4c1cdf03f9cfda7338ca878f5 (diff)
downloadrust-5dea5d404c389417e960c52ed5f386699a13d904.tar.gz
rust-5dea5d404c389417e960c52ed5f386699a13d904.zip
Fix dogfood errors
-rw-r--r--clippy_lints/src/utils/hir_utils.rs33
1 files changed, 8 insertions, 25 deletions
diff --git a/clippy_lints/src/utils/hir_utils.rs b/clippy_lints/src/utils/hir_utils.rs
index 77d6a52f57f..702738b6696 100644
--- a/clippy_lints/src/utils/hir_utils.rs
+++ b/clippy_lints/src/utils/hir_utils.rs
@@ -411,9 +411,6 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
                     self.hash_name(i.ident.name);
                 }
             },
-            ExprKind::Yield(ref e) => {
-                self.hash_expr(e);
-            },
             ExprKind::Assign(ref l, ref r) => {
                 self.hash_expr(l);
                 self.hash_expr(r);
@@ -439,14 +436,14 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
                     self.hash_expr(&*j);
                 }
             },
-            ExprKind::Box(ref e) => {
+            ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e) => {
                 self.hash_expr(e);
             },
             ExprKind::Call(ref fun, ref args) => {
                 self.hash_expr(fun);
                 self.hash_exprs(args);
             },
-            ExprKind::Cast(ref e, ref _ty) => {
+            ExprKind::Cast(ref e, ref _ty) | ExprKind::Type(ref e, ref _ty) => {
                 self.hash_expr(e);
                 // TODO: _ty
             },
@@ -466,7 +463,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
                 self.hash_expr(a);
                 self.hash_expr(i);
             },
-            ExprKind::InlineAsm(..) => {},
+            ExprKind::InlineAsm(..) | ExprKind::Err => {},
             ExprKind::Lit(ref l) => {
                 l.hash(&mut self.s);
             },
@@ -520,20 +517,13 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
                     self.hash_expr(e);
                 }
             },
-            ExprKind::Tup(ref tup) => {
-                self.hash_exprs(tup);
-            },
-            ExprKind::Type(ref e, ref _ty) => {
-                self.hash_expr(e);
-                // TODO: _ty
+            ExprKind::Tup(ref v) | ExprKind::Array(ref v) => {
+                self.hash_exprs(v);
             },
             ExprKind::Unary(lop, ref le) => {
                 lop.hash(&mut self.s);
                 self.hash_expr(le);
             },
-            ExprKind::Array(ref v) => {
-                self.hash_exprs(v);
-            },
             ExprKind::While(ref cond, ref b, l) => {
                 self.hash_expr(cond);
                 self.hash_block(b);
@@ -541,10 +531,6 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
                     self.hash_name(l.ident.name);
                 }
             },
-            ExprKind::Err => {},
-            ExprKind::DropTemps(ref e) => {
-                self.hash_expr(e);
-            },
         }
     }
 
@@ -580,17 +566,14 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
     pub fn hash_stmt(&mut self, b: &Stmt) {
         std::mem::discriminant(&b.node).hash(&mut self.s);
 
-        match b.node {
-            StmtKind::Local(ref local) => {
+        match &b.node {
+            StmtKind::Local(local) => {
                 if let Some(ref init) = local.init {
                     self.hash_expr(init);
                 }
             },
             StmtKind::Item(..) => {},
-            StmtKind::Expr(ref expr) => {
-                self.hash_expr(expr);
-            },
-            StmtKind::Semi(ref expr) => {
+            StmtKind::Expr(expr) | StmtKind::Semi(expr) => {
                 self.hash_expr(expr);
             },
         }