From 3936aff2169a1f61633de2bc475face3a2682efb Mon Sep 17 00:00:00 2001 From: John Kåre Alsaker Date: Mon, 3 Dec 2018 01:14:35 +0100 Subject: Use derive macro for HashStable --- src/librustc_data_structures/thin_vec.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/librustc_data_structures') diff --git a/src/librustc_data_structures/thin_vec.rs b/src/librustc_data_structures/thin_vec.rs index ed57c528f51..52f23f4893e 100644 --- a/src/librustc_data_structures/thin_vec.rs +++ b/src/librustc_data_structures/thin_vec.rs @@ -1,3 +1,5 @@ +use crate::stable_hasher::{StableHasher, StableHasherResult, HashStable}; + /// A vector type optimized for cases where this size is usually 0 (cf. `SmallVector`). /// The `Option>` wrapping allows us to represent a zero sized vector with `None`, /// which uses only a single (null) pointer. @@ -56,3 +58,11 @@ impl Extend for ThinVec { } } } + +impl, CTX> HashStable for ThinVec { + fn hash_stable(&self, + hcx: &mut CTX, + hasher: &mut StableHasher) { + (**self).hash_stable(hcx, hasher) + } +} -- cgit 1.4.1-3-g733a5