@@ -406,51 +406,35 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
406
406
407
407
match e. node {
408
408
ExprKind :: AddrOf ( m, ref e) => {
409
- let c: fn ( _, _) -> _ = ExprKind :: AddrOf ;
410
- c. hash ( & mut self . s ) ;
411
409
m. hash ( & mut self . s ) ;
412
410
self . hash_expr ( e) ;
413
411
} ,
414
412
ExprKind :: Continue ( i) => {
415
- let c: fn ( _) -> _ = ExprKind :: Continue ;
416
- c. hash ( & mut self . s ) ;
417
413
if let Some ( i) = i. label {
418
414
self . hash_name ( i. ident . name ) ;
419
415
}
420
416
} ,
421
417
ExprKind :: Yield ( ref e) => {
422
- let c: fn ( _) -> _ = ExprKind :: Yield ;
423
- c. hash ( & mut self . s ) ;
424
418
self . hash_expr ( e) ;
425
419
} ,
426
420
ExprKind :: Assign ( ref l, ref r) => {
427
- let c: fn ( _, _) -> _ = ExprKind :: Assign ;
428
- c. hash ( & mut self . s ) ;
429
421
self . hash_expr ( l) ;
430
422
self . hash_expr ( r) ;
431
423
} ,
432
424
ExprKind :: AssignOp ( ref o, ref l, ref r) => {
433
- let c: fn ( _, _, _) -> _ = ExprKind :: AssignOp ;
434
- c. hash ( & mut self . s ) ;
435
425
o. hash ( & mut self . s ) ;
436
426
self . hash_expr ( l) ;
437
427
self . hash_expr ( r) ;
438
428
} ,
439
429
ExprKind :: Block ( ref b, _) => {
440
- let c: fn ( _, _) -> _ = ExprKind :: Block ;
441
- c. hash ( & mut self . s ) ;
442
430
self . hash_block ( b) ;
443
431
} ,
444
432
ExprKind :: Binary ( op, ref l, ref r) => {
445
- let c: fn ( _, _, _) -> _ = ExprKind :: Binary ;
446
- c. hash ( & mut self . s ) ;
447
433
op. node . hash ( & mut self . s ) ;
448
434
self . hash_expr ( l) ;
449
435
self . hash_expr ( r) ;
450
436
} ,
451
437
ExprKind :: Break ( i, ref j) => {
452
- let c: fn ( _, _) -> _ = ExprKind :: Break ;
453
- c. hash ( & mut self . s ) ;
454
438
if let Some ( i) = i. label {
455
439
self . hash_name ( i. ident . name ) ;
456
440
}
@@ -459,25 +443,17 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
459
443
}
460
444
} ,
461
445
ExprKind :: Box ( ref e) => {
462
- let c: fn ( _) -> _ = ExprKind :: Box ;
463
- c. hash ( & mut self . s ) ;
464
446
self . hash_expr ( e) ;
465
447
} ,
466
448
ExprKind :: Call ( ref fun, ref args) => {
467
- let c: fn ( _, _) -> _ = ExprKind :: Call ;
468
- c. hash ( & mut self . s ) ;
469
449
self . hash_expr ( fun) ;
470
450
self . hash_exprs ( args) ;
471
451
} ,
472
452
ExprKind :: Cast ( ref e, ref _ty) => {
473
- let c: fn ( _, _) -> _ = ExprKind :: Cast ;
474
- c. hash ( & mut self . s ) ;
475
453
self . hash_expr ( e) ;
476
454
// TODO: _ty
477
455
} ,
478
456
ExprKind :: Closure ( cap, _, eid, _, _) => {
479
- let c: fn ( _, _, _, _, _) -> _ = ExprKind :: Closure ;
480
- c. hash ( & mut self . s ) ;
481
457
match cap {
482
458
CaptureClause :: CaptureByValue => 0 ,
483
459
CaptureClause :: CaptureByRef => 1 ,
@@ -486,46 +462,31 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
486
462
self . hash_expr ( & self . cx . tcx . hir ( ) . body ( eid) . value ) ;
487
463
} ,
488
464
ExprKind :: Field ( ref e, ref f) => {
489
- let c: fn ( _, _) -> _ = ExprKind :: Field ;
490
- c. hash ( & mut self . s ) ;
491
465
self . hash_expr ( e) ;
492
466
self . hash_name ( f. name ) ;
493
467
} ,
494
468
ExprKind :: Index ( ref a, ref i) => {
495
- let c: fn ( _, _) -> _ = ExprKind :: Index ;
496
- c. hash ( & mut self . s ) ;
497
469
self . hash_expr ( a) ;
498
470
self . hash_expr ( i) ;
499
471
} ,
500
- ExprKind :: InlineAsm ( ..) => {
501
- let c: fn ( _, _, _) -> _ = ExprKind :: InlineAsm ;
502
- c. hash ( & mut self . s ) ;
503
- } ,
472
+ ExprKind :: InlineAsm ( ..) => { } ,
504
473
ExprKind :: If ( ref cond, ref t, ref e) => {
505
- let c: fn ( _, _, _) -> _ = ExprKind :: If ;
506
- c. hash ( & mut self . s ) ;
507
474
self . hash_expr ( cond) ;
508
475
self . hash_expr ( & * * t) ;
509
476
if let Some ( ref e) = * e {
510
477
self . hash_expr ( e) ;
511
478
}
512
479
} ,
513
480
ExprKind :: Lit ( ref l) => {
514
- let c: fn ( _) -> _ = ExprKind :: Lit ;
515
- c. hash ( & mut self . s ) ;
516
481
l. hash ( & mut self . s ) ;
517
482
} ,
518
483
ExprKind :: Loop ( ref b, ref i, _) => {
519
- let c: fn ( _, _, _) -> _ = ExprKind :: Loop ;
520
- c. hash ( & mut self . s ) ;
521
484
self . hash_block ( b) ;
522
485
if let Some ( i) = * i {
523
486
self . hash_name ( i. ident . name ) ;
524
487
}
525
488
} ,
526
489
ExprKind :: Match ( ref e, ref arms, ref s) => {
527
- let c: fn ( _, _, _) -> _ = ExprKind :: Match ;
528
- c. hash ( & mut self . s ) ;
529
490
self . hash_expr ( e) ;
530
491
531
492
for arm in arms {
@@ -539,36 +500,25 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
539
500
s. hash ( & mut self . s ) ;
540
501
} ,
541
502
ExprKind :: MethodCall ( ref path, ref _tys, ref args) => {
542
- let c: fn ( _, _, _) -> _ = ExprKind :: MethodCall ;
543
- c. hash ( & mut self . s ) ;
544
503
self . hash_name ( path. ident . name ) ;
545
504
self . hash_exprs ( args) ;
546
505
} ,
547
506
ExprKind :: Repeat ( ref e, ref l_id) => {
548
- let c: fn ( _, _) -> _ = ExprKind :: Repeat ;
549
- c. hash ( & mut self . s ) ;
550
507
self . hash_expr ( e) ;
551
508
let full_table = self . tables ;
552
509
self . tables = self . cx . tcx . body_tables ( l_id. body ) ;
553
510
self . hash_expr ( & self . cx . tcx . hir ( ) . body ( l_id. body ) . value ) ;
554
511
self . tables = full_table;
555
512
} ,
556
513
ExprKind :: Ret ( ref e) => {
557
- let c: fn ( _) -> _ = ExprKind :: Ret ;
558
- c. hash ( & mut self . s ) ;
559
514
if let Some ( ref e) = * e {
560
515
self . hash_expr ( e) ;
561
516
}
562
517
} ,
563
518
ExprKind :: Path ( ref qpath) => {
564
- let c: fn ( _) -> _ = ExprKind :: Path ;
565
- c. hash ( & mut self . s ) ;
566
519
self . hash_qpath ( qpath) ;
567
520
} ,
568
521
ExprKind :: Struct ( ref path, ref fields, ref expr) => {
569
- let c: fn ( _, _, _) -> _ = ExprKind :: Struct ;
570
- c. hash ( & mut self . s ) ;
571
-
572
522
self . hash_qpath ( path) ;
573
523
574
524
for f in fields {
@@ -581,33 +531,20 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
581
531
}
582
532
} ,
583
533
ExprKind :: Tup ( ref tup) => {
584
- let c: fn ( _) -> _ = ExprKind :: Tup ;
585
- c. hash ( & mut self . s ) ;
586
534
self . hash_exprs ( tup) ;
587
535
} ,
588
536
ExprKind :: Type ( ref e, ref _ty) => {
589
- let c: fn ( _, _) -> _ = ExprKind :: Type ;
590
- c. hash ( & mut self . s ) ;
591
537
self . hash_expr ( e) ;
592
538
// TODO: _ty
593
539
} ,
594
540
ExprKind :: Unary ( lop, ref le) => {
595
- let c: fn ( _, _) -> _ = ExprKind :: Unary ;
596
- c. hash ( & mut self . s ) ;
597
-
598
541
lop. hash ( & mut self . s ) ;
599
542
self . hash_expr ( le) ;
600
543
} ,
601
544
ExprKind :: Array ( ref v) => {
602
- let c: fn ( _) -> _ = ExprKind :: Array ;
603
- c. hash ( & mut self . s ) ;
604
-
605
545
self . hash_exprs ( v) ;
606
546
} ,
607
547
ExprKind :: While ( ref cond, ref b, l) => {
608
- let c: fn ( _, _, _) -> _ = ExprKind :: While ;
609
- c. hash ( & mut self . s ) ;
610
-
611
548
self . hash_expr ( cond) ;
612
549
self . hash_block ( b) ;
613
550
if let Some ( l) = l {
@@ -616,8 +553,6 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
616
553
} ,
617
554
ExprKind :: Err => { } ,
618
555
ExprKind :: DropTemps ( ref e) => {
619
- let c: fn ( _) -> _ = ExprKind :: DropTemps ;
620
- c. hash ( & mut self . s ) ;
621
556
self . hash_expr ( e) ;
622
557
} ,
623
558
}
@@ -655,24 +590,15 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
655
590
pub fn hash_stmt ( & mut self , b : & Stmt ) {
656
591
match b. node {
657
592
StmtKind :: Local ( ref local) => {
658
- let c: fn ( _) -> _ = StmtKind :: Local ;
659
- c. hash ( & mut self . s ) ;
660
593
if let Some ( ref init) = local. init {
661
594
self . hash_expr ( init) ;
662
595
}
663
596
} ,
664
- StmtKind :: Item ( ..) => {
665
- let c: fn ( _) -> _ = StmtKind :: Item ;
666
- c. hash ( & mut self . s ) ;
667
- } ,
597
+ StmtKind :: Item ( ..) => { } ,
668
598
StmtKind :: Expr ( ref expr) => {
669
- let c: fn ( _) -> _ = StmtKind :: Expr ;
670
- c. hash ( & mut self . s ) ;
671
599
self . hash_expr ( expr) ;
672
600
} ,
673
601
StmtKind :: Semi ( ref expr) => {
674
- let c: fn ( _) -> _ = StmtKind :: Semi ;
675
- c. hash ( & mut self . s ) ;
676
602
self . hash_expr ( expr) ;
677
603
} ,
678
604
}
@@ -681,8 +607,6 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
681
607
pub fn hash_guard ( & mut self , g : & Guard ) {
682
608
match g {
683
609
Guard :: If ( ref expr) => {
684
- let c: fn ( _) -> _ = Guard :: If ;
685
- c. hash ( & mut self . s ) ;
686
610
self . hash_expr ( expr) ;
687
611
} ,
688
612
}
0 commit comments