From 7fc84907dc39bf36050ec0dfd57f82079f09d993 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Fri, 2 Jun 2017 17:34:24 +0200 Subject: ICH: Add some HashStable implementations. --- src/librustc_data_structures/stable_hasher.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/librustc_data_structures') diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs index 635b95d861d..634d3041bf4 100644 --- a/src/librustc_data_structures/stable_hasher.rs +++ b/src/librustc_data_structures/stable_hasher.rs @@ -244,6 +244,14 @@ impl HashStable for f64 { } } +impl, CTX> HashStable for (T1,) { + fn hash_stable(&self, + ctx: &mut CTX, + hasher: &mut StableHasher) { + self.0.hash_stable(ctx, hasher); + } +} + impl, T2: HashStable, CTX> HashStable for (T1, T2) { fn hash_stable(&self, ctx: &mut CTX, @@ -273,6 +281,24 @@ impl, CTX> HashStable for Vec { } } +impl, CTX> HashStable for ::std::rc::Rc { + #[inline] + fn hash_stable(&self, + ctx: &mut CTX, + hasher: &mut StableHasher) { + (**self).hash_stable(ctx, hasher); + } +} + +impl, CTX> HashStable for ::std::sync::Arc { + #[inline] + fn hash_stable(&self, + ctx: &mut CTX, + hasher: &mut StableHasher) { + (**self).hash_stable(ctx, hasher); + } +} + impl HashStable for str { #[inline] fn hash_stable(&self, -- cgit 1.4.1-3-g733a5