Skip to content

Commit

Permalink
Fix dogfood errors
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed May 14, 2019
1 parent 4b4d734 commit 5dea5d4
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions clippy_lints/src/utils/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
},
Expand All @@ -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);
},
Expand Down Expand Up @@ -520,31 +517,20 @@ 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);
if let Some(l) = l {
self.hash_name(l.ident.name);
}
},
ExprKind::Err => {},
ExprKind::DropTemps(ref e) => {
self.hash_expr(e);
},
}
}

Expand Down Expand Up @@ -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);
},
}
Expand Down

0 comments on commit 5dea5d4

Please sign in to comment.