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