@@ -2,10 +2,8 @@ use std::cell::Cell;
2
2
use std::fmt;
3
3
use std::mem;
4
4
5
- use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
6
5
use rustc_hir::{self as hir, def_id::DefId, definitions::DefPathData};
7
6
use rustc_index::vec::IndexVec;
8
- use rustc_macros::HashStable;
9
7
use rustc_middle::mir;
10
8
use rustc_middle::mir::interpret::{InterpError, InvalidProgramInfo};
11
9
use rustc_middle::ty::layout::{
@@ -16,7 +14,6 @@ use rustc_middle::ty::{
16
14
self, query::TyCtxtAt, subst::SubstsRef, ParamEnv, Ty, TyCtxt, TypeFoldable,
17
15
};
18
16
use rustc_mir_dataflow::storage::always_storage_live_locals;
19
- use rustc_query_system::ich::StableHashingContext;
20
17
use rustc_session::Limit;
21
18
use rustc_span::{Pos, Span};
22
19
use rustc_target::abi::{call::FnAbi, Align, HasDataLayout, Size, TargetDataLayout};
@@ -142,7 +139,7 @@ pub struct FrameInfo<'tcx> {
142
139
}
143
140
144
141
/// Unwind information.
145
- #[derive(Clone, Copy, Eq, PartialEq, Debug, HashStable )]
142
+ #[derive(Clone, Copy, Eq, PartialEq, Debug)]
146
143
pub enum StackPopUnwind {
147
144
/// The cleanup block.
148
145
Cleanup(mir::BasicBlock),
@@ -152,7 +149,7 @@ pub enum StackPopUnwind {
152
149
NotAllowed,
153
150
}
154
151
155
- #[derive(Clone, Copy, Eq, PartialEq, Debug, HashStable )] // Miri debug-prints these
152
+ #[derive(Clone, Copy, Eq, PartialEq, Debug)] // Miri debug-prints these
156
153
pub enum StackPopCleanup {
157
154
/// Jump to the next block in the caller, or cause UB if None (that's a function
158
155
/// that may never return). Also store layout of return place so
@@ -168,16 +165,15 @@ pub enum StackPopCleanup {
168
165
}
169
166
170
167
/// State of a local variable including a memoized layout
171
- #[derive(Clone, Debug, PartialEq, Eq, HashStable )]
168
+ #[derive(Clone, Debug)]
172
169
pub struct LocalState<'tcx, Tag: Provenance = AllocId> {
173
170
pub value: LocalValue<Tag>,
174
171
/// Don't modify if `Some`, this is only used to prevent computing the layout twice
175
- #[stable_hasher(ignore)]
176
172
pub layout: Cell<Option<TyAndLayout<'tcx>>>,
177
173
}
178
174
179
175
/// Current value of a local variable
180
- #[derive(Copy, Clone, PartialEq, Eq, HashStable, Debug)] // Miri debug-prints these
176
+ #[derive(Copy, Clone, Debug)] // Miri debug-prints these
181
177
pub enum LocalValue<Tag: Provenance = AllocId> {
182
178
/// This local is not currently alive, and cannot be used at all.
183
179
Dead,
@@ -678,7 +674,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
678
674
body,
679
675
loc: Err(body.span), // Span used for errors caused during preamble.
680
676
return_to_block,
681
- return_place: * return_place,
677
+ return_place: return_place.clone() ,
682
678
// empty local array, we fill it in below, after we are inside the stack frame and
683
679
// all methods actually know about the frame
684
680
locals: IndexVec::new(),
@@ -799,7 +795,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
799
795
let op = self
800
796
.local_to_op(self.frame(), mir::RETURN_PLACE, None)
801
797
.expect("return place should always be live");
802
- let dest = self.frame().return_place;
798
+ let dest = self.frame().return_place.clone() ;
803
799
let err = self.copy_op(&op, &dest, /*allow_transmute*/ true);
804
800
trace!("return value: {:?}", self.dump_place(*dest));
805
801
// We delay actually short-circuiting on this error until *after* the stack frame is
@@ -1021,31 +1017,3 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> std::fmt::Debug
1021
1017
}
1022
1018
}
1023
1019
}
1024
-
1025
- impl<'ctx, 'mir, 'tcx, Tag: Provenance, Extra> HashStable<StableHashingContext<'ctx>>
1026
- for Frame<'mir, 'tcx, Tag, Extra>
1027
- where
1028
- Extra: HashStable<StableHashingContext<'ctx>>,
1029
- Tag: HashStable<StableHashingContext<'ctx>>,
1030
- {
1031
- fn hash_stable(&self, hcx: &mut StableHashingContext<'ctx>, hasher: &mut StableHasher) {
1032
- // Exhaustive match on fields to make sure we forget no field.
1033
- let Frame {
1034
- body,
1035
- instance,
1036
- return_to_block,
1037
- return_place,
1038
- locals,
1039
- loc,
1040
- extra,
1041
- tracing_span: _,
1042
- } = self;
1043
- body.hash_stable(hcx, hasher);
1044
- instance.hash_stable(hcx, hasher);
1045
- return_to_block.hash_stable(hcx, hasher);
1046
- return_place.hash_stable(hcx, hasher);
1047
- locals.hash_stable(hcx, hasher);
1048
- loc.hash_stable(hcx, hasher);
1049
- extra.hash_stable(hcx, hasher);
1050
- }
1051
- }
0 commit comments