diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-17 06:38:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-17 06:38:14 +0100 |
| commit | fab38375bcef50ae5f7e1e3deb3e2440a6091270 (patch) | |
| tree | a0183cbc785532827a3093c763e09d7f8b07b1da /compiler/rustc_codegen_llvm/src | |
| parent | d5eb31c9347ae3c494c8d723711dacca7d1cfe8b (diff) | |
| parent | 4cf21866e8f18449ea0c41ee1ba031c05419d94c (diff) | |
| download | rust-fab38375bcef50ae5f7e1e3deb3e2440a6091270.tar.gz rust-fab38375bcef50ae5f7e1e3deb3e2440a6091270.zip | |
Rollup merge of #137095 - saethlin:use-hash64-for-hashes, r=workingjubilee
Replace some u64 hashes with Hash64 I introduced the Hash64 and Hash128 types in https://github.com/rust-lang/rust/pull/110083, essentially as a mechanism to prevent hashes from landing in our leb128 encoding paths. If you just have a u64 or u128 field in a struct then derive Encodable/Decodable, that number gets leb128 encoding. So if you need to store a hash or some other value which behaves very close to a hash, don't store it as a u64. This reverts part of https://github.com/rust-lang/rust/pull/117603, which turned an encoded Hash64 into a u64. Based on https://github.com/rust-lang/rust/pull/110083, I don't expect this to be perf-sensitive on its own, though I expect that it may help stabilize some of the small rmeta size fluctuations we currently see in perf reports.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/common.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs index 78b3a7f8541..f17d98fa242 100644 --- a/compiler/rustc_codegen_llvm/src/common.rs +++ b/compiler/rustc_codegen_llvm/src/common.rs @@ -7,7 +7,8 @@ use rustc_abi::{AddressSpace, HasDataLayout}; use rustc_ast::Mutability; use rustc_codegen_ssa::common::TypeKind; use rustc_codegen_ssa::traits::*; -use rustc_data_structures::stable_hasher::{Hash128, HashStable, StableHasher}; +use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; +use rustc_hashes::Hash128; use rustc_hir::def_id::DefId; use rustc_middle::bug; use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, Scalar}; |
