about summary refs log tree commit diff
path: root/src/librustc_data_structures/stable_hasher.rs
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2017-06-02 17:34:24 +0200
committerMichael Woerister <michaelwoerister@posteo.net>2017-06-06 13:50:13 +0200
commit7fc84907dc39bf36050ec0dfd57f82079f09d993 (patch)
treef192e52f42036d2999af3bf74fec7526f03baa0f /src/librustc_data_structures/stable_hasher.rs
parentb6e8635fefebd80647ecd2463f0c90df79c81ca4 (diff)
downloadrust-7fc84907dc39bf36050ec0dfd57f82079f09d993.tar.gz
rust-7fc84907dc39bf36050ec0dfd57f82079f09d993.zip
ICH: Add some HashStable implementations.
Diffstat (limited to 'src/librustc_data_structures/stable_hasher.rs')
-rw-r--r--src/librustc_data_structures/stable_hasher.rs26
1 files changed, 26 insertions, 0 deletions
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<CTX> HashStable<CTX> for f64 {
     }
 }
 
+impl<T1: HashStable<CTX>, CTX> HashStable<CTX> for (T1,) {
+    fn hash_stable<W: StableHasherResult>(&self,
+                                          ctx: &mut CTX,
+                                          hasher: &mut StableHasher<W>) {
+        self.0.hash_stable(ctx, hasher);
+    }
+}
+
 impl<T1: HashStable<CTX>, T2: HashStable<CTX>, CTX> HashStable<CTX> for (T1, T2) {
     fn hash_stable<W: StableHasherResult>(&self,
                                           ctx: &mut CTX,
@@ -273,6 +281,24 @@ impl<T: HashStable<CTX>, CTX> HashStable<CTX> for Vec<T> {
     }
 }
 
+impl<T: HashStable<CTX>, CTX> HashStable<CTX> for ::std::rc::Rc<T> {
+    #[inline]
+    fn hash_stable<W: StableHasherResult>(&self,
+                                          ctx: &mut CTX,
+                                          hasher: &mut StableHasher<W>) {
+        (**self).hash_stable(ctx, hasher);
+    }
+}
+
+impl<T: HashStable<CTX>, CTX> HashStable<CTX> for ::std::sync::Arc<T> {
+    #[inline]
+    fn hash_stable<W: StableHasherResult>(&self,
+                                          ctx: &mut CTX,
+                                          hasher: &mut StableHasher<W>) {
+        (**self).hash_stable(ctx, hasher);
+    }
+}
+
 impl<CTX> HashStable<CTX> for str {
     #[inline]
     fn hash_stable<W: StableHasherResult>(&self,