From e8e7ad6fb86dc07cb4466a170a38b97d38746902 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 16 Nov 2019 11:45:57 +0100 Subject: [PATCH] Implement HashStable for RangeInclusive. --- src/librustc_data_structures/stable_hasher.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs index 092208cfe1d..ce62021ac17 100644 --- a/src/librustc_data_structures/stable_hasher.rs +++ b/src/librustc_data_structures/stable_hasher.rs @@ -429,6 +429,16 @@ impl HashStable for ::std::mem::Discriminant { } } +impl HashStable for ::std::ops::RangeInclusive + where T: HashStable +{ + #[inline] + fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { + self.start().hash_stable(ctx, hasher); + self.end().hash_stable(ctx, hasher); + } +} + impl HashStable for vec::IndexVec where T: HashStable, {