Skip to content

Commit 3e969e0

Browse files
committed
Revert "Revert expansion of impl HashStable for Frame."
This reverts commit 579625b.
1 parent 083b5a0 commit 3e969e0

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::fmt::Write;
33
use std::mem;
44

55
use syntax::source_map::{self, Span, DUMMY_SP};
6+
use rustc::ich::StableHashingContext;
67
use rustc::hir::def_id::DefId;
78
use rustc::hir::def::DefKind;
89
use rustc::mir;
@@ -18,6 +19,7 @@ use rustc::mir::interpret::{
1819
InterpResult, truncate, sign_extend,
1920
};
2021
use rustc_data_structures::fx::FxHashMap;
22+
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
2123
use rustc_macros::HashStable;
2224

2325
use super::{
@@ -829,3 +831,21 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
829831
frames
830832
}
831833
}
834+
835+
impl<'ctx, 'mir, 'tcx, Tag, Extra> HashStable<StableHashingContext<'ctx>>
836+
for Frame<'mir, 'tcx, Tag, Extra>
837+
where Extra: HashStable<StableHashingContext<'ctx>>,
838+
Tag: HashStable<StableHashingContext<'ctx>>
839+
{
840+
fn hash_stable(&self, hcx: &mut StableHashingContext<'ctx>, hasher: &mut StableHasher) {
841+
self.body.hash_stable(hcx, hasher);
842+
self.instance.hash_stable(hcx, hasher);
843+
self.span.hash_stable(hcx, hasher);
844+
self.return_to_block.hash_stable(hcx, hasher);
845+
self.return_place.as_ref().map(|r| &**r).hash_stable(hcx, hasher);
846+
self.locals.hash_stable(hcx, hasher);
847+
self.block.hash_stable(hcx, hasher);
848+
self.stmt.hash_stable(hcx, hasher);
849+
self.extra.hash_stable(hcx, hasher);
850+
}
851+
}

src/librustc_mir/interpret/snapshot.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,18 +304,6 @@ struct FrameSnapshot<'a, 'tcx> {
304304
stmt: usize,
305305
}
306306

307-
impl_stable_hash_for!(impl<> for struct Frame<'mir, 'tcx> {
308-
body,
309-
instance,
310-
span,
311-
return_to_block,
312-
return_place -> (return_place.as_ref().map(|r| &**r)),
313-
locals,
314-
block,
315-
stmt,
316-
extra,
317-
});
318-
319307
impl<'a, 'mir, 'tcx, Ctx> Snapshot<'a, Ctx> for &'a Frame<'mir, 'tcx>
320308
where Ctx: SnapshotContext<'a>,
321309
{

0 commit comments

Comments
 (0)