From 1d7cf0ff407beea447334c2784d39658e4be3ca0 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Sat, 15 Feb 2025 13:57:21 -0500 Subject: Replace some u64 hashes with Hash64 --- compiler/rustc_data_structures/src/hashes.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/rustc_data_structures/src') 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 for Hash64 { -- cgit 1.4.1-3-g733a5