@@ -436,17 +436,18 @@ impl<'a, 'gcx, 'tcx, H: Hasher> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tc
436436 TyInt ( i) => self . hash ( i) ,
437437 TyUint ( u) => self . hash ( u) ,
438438 TyFloat ( f) => self . hash ( f) ,
439- TyAdt ( d, _) => self . def_id ( d. did ) ,
440439 TyArray ( _, n) => self . hash ( n) ,
441440 TyRawPtr ( m) |
442441 TyRef ( _, m) => self . hash ( m. mutbl ) ,
443442 TyClosure ( def_id, _) |
444443 TyAnon ( def_id, _) |
445444 TyFnDef ( def_id, ..) => self . def_id ( def_id) ,
445+ TyAdt ( d, _) => self . def_id ( d. did ) ,
446446 TyFnPtr ( f) => {
447447 self . hash ( f. unsafety ) ;
448448 self . hash ( f. abi ) ;
449449 self . hash ( f. sig . variadic ( ) ) ;
450+ self . hash ( f. sig . inputs ( ) . skip_binder ( ) . len ( ) ) ;
450451 }
451452 TyTrait ( ref data) => {
452453 self . def_id ( data. principal . def_id ( ) ) ;
@@ -468,32 +469,34 @@ impl<'a, 'gcx, 'tcx, H: Hasher> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tc
468469 TyChar |
469470 TyStr |
470471 TyBox ( _) |
471- TySlice ( _) |
472- TyError => { }
473- TyInfer ( _) => bug ! ( )
472+ TySlice ( _) => { }
473+
474+ TyError |
475+ TyInfer ( _) => bug ! ( "TypeIdHasher: unexpected type {}" , ty)
474476 }
475477
476478 ty. super_visit_with ( self )
477479 }
478480
479481 fn visit_region ( & mut self , r : & ' tcx ty:: Region ) -> bool {
480482 match * r {
481- ty:: ReStatic | ty :: ReErased => {
483+ ty:: ReErased => {
482484 self . hash :: < u32 > ( 0 ) ;
483485 }
484486 ty:: ReLateBound ( db, ty:: BrAnon ( i) ) => {
485487 assert ! ( db. depth > 0 ) ;
486488 self . hash :: < u32 > ( db. depth ) ;
487489 self . hash ( i) ;
488490 }
491+ ty:: ReStatic |
489492 ty:: ReEmpty |
490493 ty:: ReEarlyBound ( ..) |
491494 ty:: ReLateBound ( ..) |
492495 ty:: ReFree ( ..) |
493496 ty:: ReScope ( ..) |
494497 ty:: ReVar ( ..) |
495498 ty:: ReSkolemized ( ..) => {
496- bug ! ( "unexpected region found when hashing a type" )
499+ bug ! ( "TypeIdHasher: unexpected region {:?}" , r )
497500 }
498501 }
499502 false
0 commit comments