From c47cdc0d93726429ee18b418b1f85fae67b82d41 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Thu, 30 Mar 2017 15:27:27 +0200 Subject: Introduce HashStable trait and base ICH implementations on it. This initial commit provides implementations for HIR, MIR, and everything that also needs to be supported for those two. --- src/libsyntax/util/rc_slice.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/libsyntax/util') diff --git a/src/libsyntax/util/rc_slice.rs b/src/libsyntax/util/rc_slice.rs index 195fb23f9d8..2d9fd7aa875 100644 --- a/src/libsyntax/util/rc_slice.rs +++ b/src/libsyntax/util/rc_slice.rs @@ -12,6 +12,9 @@ use std::fmt; use std::ops::Deref; use std::rc::Rc; +use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult, + HashStable}; + #[derive(Clone)] pub struct RcSlice { data: Rc>, @@ -41,3 +44,13 @@ impl fmt::Debug for RcSlice { fmt::Debug::fmt(self.deref(), f) } } + +impl HashStable for RcSlice + where T: HashStable +{ + fn hash_stable(&self, + hcx: &mut CTX, + hasher: &mut StableHasher) { + (**self).hash_stable(hcx, hasher); + } +} -- cgit 1.4.1-3-g733a5