about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorBruno Dutra <brunocodutra@gmail.com>2018-08-05 00:01:11 +0200
committerBruno Dutra <brunocodutra@gmail.com>2018-09-03 20:02:35 +0200
commita083aa02edf0a3cb963dc71aea1509afe6e179a0 (patch)
tree3b9691c90c5084db29037b018ddbcfb9ac1d0a57 /src/librustc_data_structures
parent030077401d6b7c2f923b24271dc5dc80044b089a (diff)
downloadrust-a083aa02edf0a3cb963dc71aea1509afe6e179a0.tar.gz
rust-a083aa02edf0a3cb963dc71aea1509afe6e179a0.zip
Implement Hash in terms of HashStable for EvalSnapshot
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/stable_hasher.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs
index 1024e69cc2b..c70a0abe8c7 100644
--- a/src/librustc_data_structures/stable_hasher.rs
+++ b/src/librustc_data_structures/stable_hasher.rs
@@ -281,6 +281,23 @@ impl<T1, T2, T3, CTX> HashStable<CTX> for (T1, T2, T3)
     }
 }
 
+impl<T1, T2, T3, T4, CTX> HashStable<CTX> for (T1, T2, T3, T4)
+     where T1: HashStable<CTX>,
+           T2: HashStable<CTX>,
+           T3: HashStable<CTX>,
+           T4: HashStable<CTX>,
+{
+    fn hash_stable<W: StableHasherResult>(&self,
+                                          ctx: &mut CTX,
+                                          hasher: &mut StableHasher<W>) {
+        let (ref _0, ref _1, ref _2, ref _3) = *self;
+        _0.hash_stable(ctx, hasher);
+        _1.hash_stable(ctx, hasher);
+        _2.hash_stable(ctx, hasher);
+        _3.hash_stable(ctx, hasher);
+    }
+}
+
 impl<T: HashStable<CTX>, CTX> HashStable<CTX> for [T] {
     default fn hash_stable<W: StableHasherResult>(&self,
                                                   ctx: &mut CTX,