@@ -411,9 +411,6 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
411
411
self . hash_name ( i. ident . name ) ;
412
412
}
413
413
} ,
414
- ExprKind :: Yield ( ref e) => {
415
- self . hash_expr ( e) ;
416
- } ,
417
414
ExprKind :: Assign ( ref l, ref r) => {
418
415
self . hash_expr ( l) ;
419
416
self . hash_expr ( r) ;
@@ -439,14 +436,14 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
439
436
self . hash_expr ( & * j) ;
440
437
}
441
438
} ,
442
- ExprKind :: Box ( ref e) => {
439
+ ExprKind :: Box ( ref e) | ExprKind :: DropTemps ( ref e ) | ExprKind :: Yield ( ref e ) => {
443
440
self . hash_expr ( e) ;
444
441
} ,
445
442
ExprKind :: Call ( ref fun, ref args) => {
446
443
self . hash_expr ( fun) ;
447
444
self . hash_exprs ( args) ;
448
445
} ,
449
- ExprKind :: Cast ( ref e, ref _ty) => {
446
+ ExprKind :: Cast ( ref e, ref _ty) | ExprKind :: Type ( ref e , ref _ty ) => {
450
447
self . hash_expr ( e) ;
451
448
// TODO: _ty
452
449
} ,
@@ -466,7 +463,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
466
463
self . hash_expr ( a) ;
467
464
self . hash_expr ( i) ;
468
465
} ,
469
- ExprKind :: InlineAsm ( ..) => { } ,
466
+ ExprKind :: InlineAsm ( ..) | ExprKind :: Err => { } ,
470
467
ExprKind :: Lit ( ref l) => {
471
468
l. hash ( & mut self . s ) ;
472
469
} ,
@@ -520,31 +517,20 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
520
517
self . hash_expr ( e) ;
521
518
}
522
519
} ,
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) ;
529
522
} ,
530
523
ExprKind :: Unary ( lop, ref le) => {
531
524
lop. hash ( & mut self . s ) ;
532
525
self . hash_expr ( le) ;
533
526
} ,
534
- ExprKind :: Array ( ref v) => {
535
- self . hash_exprs ( v) ;
536
- } ,
537
527
ExprKind :: While ( ref cond, ref b, l) => {
538
528
self . hash_expr ( cond) ;
539
529
self . hash_block ( b) ;
540
530
if let Some ( l) = l {
541
531
self . hash_name ( l. ident . name ) ;
542
532
}
543
533
} ,
544
- ExprKind :: Err => { } ,
545
- ExprKind :: DropTemps ( ref e) => {
546
- self . hash_expr ( e) ;
547
- } ,
548
534
}
549
535
}
550
536
@@ -580,17 +566,14 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
580
566
pub fn hash_stmt ( & mut self , b : & Stmt ) {
581
567
std:: mem:: discriminant ( & b. node ) . hash ( & mut self . s ) ;
582
568
583
- match b. node {
584
- StmtKind :: Local ( ref local) => {
569
+ match & b. node {
570
+ StmtKind :: Local ( local) => {
585
571
if let Some ( ref init) = local. init {
586
572
self . hash_expr ( init) ;
587
573
}
588
574
} ,
589
575
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) => {
594
577
self . hash_expr ( expr) ;
595
578
} ,
596
579
}
0 commit comments