diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-06-21 07:37:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-21 07:37:01 +0200 |
| commit | 34c8e53d7a7fcf3bfb3340e9f61d5cf6494c4f6d (patch) | |
| tree | 70f3bc3b61232716f522393cb1a1774176e89c96 /compiler/rustc_data_structures/src | |
| parent | 78a90cb4ee8a29d6dda00d0b79373daa38e29f17 (diff) | |
| parent | 689607e7a3c601a4982fb5dbddc99ee79b08a525 (diff) | |
| download | rust-34c8e53d7a7fcf3bfb3340e9f61d5cf6494c4f6d.tar.gz rust-34c8e53d7a7fcf3bfb3340e9f61d5cf6494c4f6d.zip | |
Rollup merge of #112759 - cjgillot:closure-names, r=oli-obk
Make closure_saved_names_of_captured_variables a query. As we will start removing debuginfo during MIR optimizations, we need to keep them somewhere.
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>, |
