File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1686,6 +1686,8 @@ impl Hasher for TypeIdHasher {
1686
1686
1687
1687
#[ inline]
1688
1688
fn write_u64 ( & mut self , value : u64 ) {
1689
+ // The internal hash function of TypeId only takes the bottom 64-bits, even on versions
1690
+ // of Rust that use a 128-bit TypeId.
1689
1691
let prev_state = self . state . replace ( value) ;
1690
1692
debug_assert_eq ! ( prev_state, None ) ;
1691
1693
}
@@ -1712,8 +1714,14 @@ impl BuildHasher for BuildTypeIdHasher {
1712
1714
}
1713
1715
1714
1716
const _: ( ) = {
1715
- assert ! ( size_of:: <TypeId >( ) == size_of:: <u64 >( ) ) ;
1716
- assert ! ( align_of:: <TypeId >( ) == align_of:: <u64 >( ) ) ;
1717
+ assert ! (
1718
+ size_of:: <TypeId >( ) == size_of:: <u64 >( )
1719
+ || size_of:: <TypeId >( ) == size_of:: <u128 >( )
1720
+ ) ;
1721
+ assert ! (
1722
+ align_of:: <TypeId >( ) == align_of:: <u64 >( )
1723
+ || align_of:: <TypeId >( ) == align_of:: <u128 >( )
1724
+ ) ;
1717
1725
} ;
1718
1726
1719
1727
pub ( crate ) struct RawSlot {
You can’t perform that action at this time.
0 commit comments