Skip to content

Commit 5dea5d4

Browse files
committed
Fix dogfood errors
1 parent 4b4d734 commit 5dea5d4

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

clippy_lints/src/utils/hir_utils.rs

+8-25
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,6 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
411411
self.hash_name(i.ident.name);
412412
}
413413
},
414-
ExprKind::Yield(ref e) => {
415-
self.hash_expr(e);
416-
},
417414
ExprKind::Assign(ref l, ref r) => {
418415
self.hash_expr(l);
419416
self.hash_expr(r);
@@ -439,14 +436,14 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
439436
self.hash_expr(&*j);
440437
}
441438
},
442-
ExprKind::Box(ref e) => {
439+
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e) => {
443440
self.hash_expr(e);
444441
},
445442
ExprKind::Call(ref fun, ref args) => {
446443
self.hash_expr(fun);
447444
self.hash_exprs(args);
448445
},
449-
ExprKind::Cast(ref e, ref _ty) => {
446+
ExprKind::Cast(ref e, ref _ty) | ExprKind::Type(ref e, ref _ty) => {
450447
self.hash_expr(e);
451448
// TODO: _ty
452449
},
@@ -466,7 +463,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
466463
self.hash_expr(a);
467464
self.hash_expr(i);
468465
},
469-
ExprKind::InlineAsm(..) => {},
466+
ExprKind::InlineAsm(..) | ExprKind::Err => {},
470467
ExprKind::Lit(ref l) => {
471468
l.hash(&mut self.s);
472469
},
@@ -520,31 +517,20 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
520517
self.hash_expr(e);
521518
}
522519
},
523-
ExprKind::Tup(ref tup) => {
524-
self.hash_exprs(tup);
525-
},
526-
ExprKind::Type(ref e, ref _ty) => {
527-
self.hash_expr(e);
528-
// TODO: _ty
520+
ExprKind::Tup(ref v) | ExprKind::Array(ref v) => {
521+
self.hash_exprs(v);
529522
},
530523
ExprKind::Unary(lop, ref le) => {
531524
lop.hash(&mut self.s);
532525
self.hash_expr(le);
533526
},
534-
ExprKind::Array(ref v) => {
535-
self.hash_exprs(v);
536-
},
537527
ExprKind::While(ref cond, ref b, l) => {
538528
self.hash_expr(cond);
539529
self.hash_block(b);
540530
if let Some(l) = l {
541531
self.hash_name(l.ident.name);
542532
}
543533
},
544-
ExprKind::Err => {},
545-
ExprKind::DropTemps(ref e) => {
546-
self.hash_expr(e);
547-
},
548534
}
549535
}
550536

@@ -580,17 +566,14 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
580566
pub fn hash_stmt(&mut self, b: &Stmt) {
581567
std::mem::discriminant(&b.node).hash(&mut self.s);
582568

583-
match b.node {
584-
StmtKind::Local(ref local) => {
569+
match &b.node {
570+
StmtKind::Local(local) => {
585571
if let Some(ref init) = local.init {
586572
self.hash_expr(init);
587573
}
588574
},
589575
StmtKind::Item(..) => {},
590-
StmtKind::Expr(ref expr) => {
591-
self.hash_expr(expr);
592-
},
593-
StmtKind::Semi(ref expr) => {
576+
StmtKind::Expr(expr) | StmtKind::Semi(expr) => {
594577
self.hash_expr(expr);
595578
},
596579
}

0 commit comments

Comments
 (0)