diff options
| author | Ben Kimock <kimockb@gmail.com> | 2025-02-15 13:57:21 -0500 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2025-02-15 13:59:09 -0500 |
| commit | 1d7cf0ff407beea447334c2784d39658e4be3ca0 (patch) | |
| tree | 245db5686a564ac6dd23781adf40fff8d777ad39 /compiler/rustc_data_structures/src | |
| parent | fc147b4a81bea997e544afa8f8f05af73c759231 (diff) | |
| download | rust-1d7cf0ff407beea447334c2784d39658e4be3ca0.tar.gz rust-1d7cf0ff407beea447334c2784d39658e4be3ca0.zip | |
Replace some u64 hashes with Hash64
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/hashes.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/hashes.rs b/compiler/rustc_data_structures/src/hashes.rs index 8f4639fc2e6..b25758048bd 100644 --- a/compiler/rustc_data_structures/src/hashes.rs +++ b/compiler/rustc_data_structures/src/hashes.rs @@ -35,6 +35,11 @@ impl Hash64 { pub fn as_u64(self) -> u64 { self.inner } + + #[inline] + pub fn wrapping_add(self, other: Self) -> Self { + Self { inner: self.inner.wrapping_add(other.inner) } + } } impl BitXorAssign<u64> for Hash64 { |
