@@ -73,18 +73,16 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ty::subst::GenericArgKin
73
73
//
74
74
// In order to make it very unlikely for the sequence of bytes being hashed for
75
75
// a `GenericArgKind::Type` to be the same as the sequence of bytes being
76
- // hashed for one of the other variants, we hash a `0xFF` byte before hashing
77
- // their discriminant ( since the discriminant of `TyKind` is unlikely to ever start
78
- // with 0xFF) .
76
+ // hashed for one of the other variants, we hash some very high number instead
77
+ // of their actual discriminant since `TyKind` should never start with anything
78
+ // that high .
79
79
ty:: subst:: GenericArgKind :: Type ( ty) => ty. hash_stable ( hcx, hasher) ,
80
80
ty:: subst:: GenericArgKind :: Const ( ct) => {
81
- 0xFFu8 . hash_stable ( hcx, hasher) ;
82
- mem:: discriminant ( self ) . hash_stable ( hcx, hasher) ;
81
+ 0xF3u8 . hash_stable ( hcx, hasher) . hash_stable ( hcx, hasher) ;
83
82
ct. hash_stable ( hcx, hasher) ;
84
83
}
85
84
ty:: subst:: GenericArgKind :: Lifetime ( lt) => {
86
- 0xFFu8 . hash_stable ( hcx, hasher) ;
87
- mem:: discriminant ( self ) . hash_stable ( hcx, hasher) ;
85
+ 0xF5u8 . hash_stable ( hcx, hasher) ;
88
86
lt. hash_stable ( hcx, hasher) ;
89
87
}
90
88
}
0 commit comments