diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-06-18 07:55:04 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-06-19 16:50:52 +0000 |
| commit | 7d5b2e4926385bb247c4e1f2480258ca3faf4f10 (patch) | |
| tree | 85e99f40424b734d6e516026b3184c3d5c4034ec /compiler/rustc_data_structures/src | |
| parent | 18a6d911caba59605eb03db1452848a85d2e5879 (diff) | |
| download | rust-7d5b2e4926385bb247c4e1f2480258ca3faf4f10.tar.gz rust-7d5b2e4926385bb247c4e1f2480258ca3faf4f10.zip | |
Make closure_saved_names_of_captured_variables a query.
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/stable_hasher.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/stable_hasher.rs b/compiler/rustc_data_structures/src/stable_hasher.rs index 0c1fb7518fa..6d75b0fb8a0 100644 --- a/compiler/rustc_data_structures/src/stable_hasher.rs +++ b/compiler/rustc_data_structures/src/stable_hasher.rs @@ -1,6 +1,6 @@ use crate::sip128::SipHasher128; use rustc_index::bit_set::{self, BitSet}; -use rustc_index::{Idx, IndexVec}; +use rustc_index::{Idx, IndexSlice, IndexVec}; use smallvec::SmallVec; use std::fmt; use std::hash::{BuildHasher, Hash, Hasher}; @@ -597,6 +597,18 @@ where } } +impl<I: Idx, T, CTX> HashStable<CTX> for IndexSlice<I, T> +where + T: HashStable<CTX>, +{ + fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { + self.len().hash_stable(ctx, hasher); + for v in &self.raw { + v.hash_stable(ctx, hasher); + } + } +} + impl<I: Idx, T, CTX> HashStable<CTX> for IndexVec<I, T> where T: HashStable<CTX>, |
