about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2019-11-16 00:11:02 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2019-11-19 20:48:11 +0100
commit579625b9e738e606b91fa315c75ab4909fa090be (patch)
tree9e9d59c91a3d94cda4f4f93a86d6b04d2cf45041
parent4da5fe7fdbb4b2a257f37fc725a756f01d2927fc (diff)
downloadrust-579625b9e738e606b91fa315c75ab4909fa090be.tar.gz
rust-579625b9e738e606b91fa315c75ab4909fa090be.zip
Revert expansion of impl HashStable for Frame.
-rw-r--r--src/librustc_mir/interpret/eval_context.rs20
-rw-r--r--src/librustc_mir/interpret/snapshot.rs12
2 files changed, 12 insertions, 20 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs
index 471227f7403..08640476f7a 100644
--- a/src/librustc_mir/interpret/eval_context.rs
+++ b/src/librustc_mir/interpret/eval_context.rs
@@ -3,7 +3,6 @@ use std::fmt::Write;
 use std::mem;
 
 use syntax::source_map::{self, Span, DUMMY_SP};
-use rustc::ich::StableHashingContext;
 use rustc::hir::def_id::DefId;
 use rustc::hir::def::DefKind;
 use rustc::mir;
@@ -19,7 +18,6 @@ use rustc::mir::interpret::{
     InterpResult, truncate, sign_extend,
 };
 use rustc_data_structures::fx::FxHashMap;
-use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 use rustc_macros::HashStable;
 
 use super::{
@@ -831,21 +829,3 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         frames
     }
 }
-
-impl<'ctx, 'mir, 'tcx, Tag, Extra> HashStable<StableHashingContext<'ctx>>
-for Frame<'mir, 'tcx, Tag, Extra>
-    where Extra: HashStable<StableHashingContext<'ctx>>,
-          Tag:   HashStable<StableHashingContext<'ctx>>
-{
-    fn hash_stable(&self, hcx: &mut StableHashingContext<'ctx>, hasher: &mut StableHasher) {
-        self.body.hash_stable(hcx, hasher);
-        self.instance.hash_stable(hcx, hasher);
-        self.span.hash_stable(hcx, hasher);
-        self.return_to_block.hash_stable(hcx, hasher);
-        self.return_place.as_ref().map(|r| &**r).hash_stable(hcx, hasher);
-        self.locals.hash_stable(hcx, hasher);
-        self.block.hash_stable(hcx, hasher);
-        self.stmt.hash_stable(hcx, hasher);
-        self.extra.hash_stable(hcx, hasher);
-    }
-}
diff --git a/src/librustc_mir/interpret/snapshot.rs b/src/librustc_mir/interpret/snapshot.rs
index 3ea00d69221..b460badd1fd 100644
--- a/src/librustc_mir/interpret/snapshot.rs
+++ b/src/librustc_mir/interpret/snapshot.rs
@@ -304,6 +304,18 @@ struct FrameSnapshot<'a, 'tcx> {
     stmt: usize,
 }
 
+impl_stable_hash_for!(impl<> for struct Frame<'mir, 'tcx> {
+    body,
+    instance,
+    span,
+    return_to_block,
+    return_place -> (return_place.as_ref().map(|r| &**r)),
+    locals,
+    block,
+    stmt,
+    extra,
+});
+
 impl<'a, 'mir, 'tcx, Ctx> Snapshot<'a, Ctx> for &'a Frame<'mir, 'tcx>
     where Ctx: SnapshotContext<'a>,
 {