about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2025-02-15 13:57:21 -0500
committerBen Kimock <kimockb@gmail.com>2025-02-15 13:59:09 -0500
commit1d7cf0ff407beea447334c2784d39658e4be3ca0 (patch)
tree245db5686a564ac6dd23781adf40fff8d777ad39 /compiler/rustc_data_structures/src
parentfc147b4a81bea997e544afa8f8f05af73c759231 (diff)
downloadrust-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.rs5
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 {