diff options
| author | Markus Reiter <me@reitermark.us> | 2024-01-29 23:59:09 +0100 |
|---|---|---|
| committer | Markus Reiter <me@reitermark.us> | 2024-02-15 08:09:42 +0100 |
| commit | 746a58d4359786e4aebb372a30829706fa5a968f (patch) | |
| tree | d8e13fb3fc93deb5aa964c863bad51f67937c104 /compiler/rustc_data_structures/src/stable_hasher.rs | |
| parent | ee9c7c940c07d8b67c9a6b2ec930db70dcd23a46 (diff) | |
| download | rust-746a58d4359786e4aebb372a30829706fa5a968f.tar.gz rust-746a58d4359786e4aebb372a30829706fa5a968f.zip | |
Use generic `NonZero` internally.
Diffstat (limited to 'compiler/rustc_data_structures/src/stable_hasher.rs')
| -rw-r--r-- | compiler/rustc_data_structures/src/stable_hasher.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/stable_hasher.rs b/compiler/rustc_data_structures/src/stable_hasher.rs index 52304c72a2f..15691804a94 100644 --- a/compiler/rustc_data_structures/src/stable_hasher.rs +++ b/compiler/rustc_data_structures/src/stable_hasher.rs @@ -6,6 +6,7 @@ use std::fmt; use std::hash::{BuildHasher, Hash, Hasher}; use std::marker::PhantomData; use std::mem; +use std::num::NonZero; #[cfg(test)] mod tests; @@ -338,14 +339,14 @@ impl<CTX, T> HashStable<CTX> for PhantomData<T> { fn hash_stable(&self, _ctx: &mut CTX, _hasher: &mut StableHasher) {} } -impl<CTX> HashStable<CTX> for ::std::num::NonZeroU32 { +impl<CTX> HashStable<CTX> for NonZero<u32> { #[inline] fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { self.get().hash_stable(ctx, hasher) } } -impl<CTX> HashStable<CTX> for ::std::num::NonZeroUsize { +impl<CTX> HashStable<CTX> for NonZero<usize> { #[inline] fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { self.get().hash_stable(ctx, hasher) |
