diff options
Diffstat (limited to 'src/librustc_data_structures/thin_vec.rs')
| -rw-r--r-- | src/librustc_data_structures/thin_vec.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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<Box<..>>` wrapping allows us to represent a zero sized vector with `None`, /// which uses only a single (null) pointer. @@ -56,3 +58,11 @@ impl<T> Extend<T> for ThinVec<T> { } } } + +impl<T: HashStable<CTX>, CTX> HashStable<CTX> for ThinVec<T> { + fn hash_stable<W: StableHasherResult>(&self, + hcx: &mut CTX, + hasher: &mut StableHasher<W>) { + (**self).hash_stable(hcx, hasher) + } +} |
