From 579625b9e738e606b91fa315c75ab4909fa090be Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 16 Nov 2019 00:11:02 +0100 Subject: [PATCH] Revert expansion of impl HashStable for Frame. --- src/librustc_mir/interpret/eval_context.rs | 20 -------------------- src/librustc_mir/interpret/snapshot.rs | 12 ++++++++++++ 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 471227f74037e..08640476f7ab7 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> -for Frame<'mir, 'tcx, Tag, Extra> - where Extra: HashStable>, - Tag: HashStable> -{ - 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 3ea00d6922186..b460badd1fdac 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>, {