This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -86,18 +86,16 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ty::subst::GenericArgKin
8686 //
8787 // In order to make it very unlikely for the sequence of bytes being hashed for
8888 // a `GenericArgKind::Type` to be the same as the sequence of bytes being
89- // hashed for one of the other variants, we hash a `0xFF` byte before hashing
90- // their discriminant ( since the discriminant of `TyKind` is unlikely to ever start
91- // with 0xFF) .
89+ // hashed for one of the other variants, we hash some very high number instead
90+ // of their actual discriminant since `TyKind` should never start with anything
91+ // that high .
9292 ty:: subst:: GenericArgKind :: Type ( ty) => ty. hash_stable ( hcx, hasher) ,
9393 ty:: subst:: GenericArgKind :: Const ( ct) => {
94- 0xFFu8 . hash_stable ( hcx, hasher) ;
95- mem:: discriminant ( self ) . hash_stable ( hcx, hasher) ;
94+ 0xF3u8 . hash_stable ( hcx, hasher) ;
9695 ct. hash_stable ( hcx, hasher) ;
9796 }
9897 ty:: subst:: GenericArgKind :: Lifetime ( lt) => {
99- 0xFFu8 . hash_stable ( hcx, hasher) ;
100- mem:: discriminant ( self ) . hash_stable ( hcx, hasher) ;
98+ 0xF5u8 . hash_stable ( hcx, hasher) ;
10199 lt. hash_stable ( hcx, hasher) ;
102100 }
103101 }
You can’t perform that action at this time.
0 commit comments