@@ -2,10 +2,8 @@ use std::cell::Cell;
22use std:: fmt;
33use std:: mem;
44
5- use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
65use rustc_hir:: { self as hir, def_id:: DefId , definitions:: DefPathData } ;
76use rustc_index:: vec:: IndexVec ;
8- use rustc_macros:: HashStable ;
97use rustc_middle:: mir;
108use rustc_middle:: mir:: interpret:: { InterpError , InvalidProgramInfo } ;
119use rustc_middle:: ty:: layout:: {
@@ -16,7 +14,6 @@ use rustc_middle::ty::{
1614 self , query:: TyCtxtAt , subst:: SubstsRef , ParamEnv , Ty , TyCtxt , TypeFoldable ,
1715} ;
1816use rustc_mir_dataflow:: storage:: always_storage_live_locals;
19- use rustc_query_system:: ich:: StableHashingContext ;
2017use rustc_session:: Limit ;
2118use rustc_span:: { Pos , Span } ;
2219use rustc_target:: abi:: { call:: FnAbi , Align , HasDataLayout , Size , TargetDataLayout } ;
@@ -142,7 +139,7 @@ pub struct FrameInfo<'tcx> {
142139}
143140
144141/// Unwind information.
145- #[ derive( Clone , Copy , Eq , PartialEq , Debug , HashStable ) ]
142+ #[ derive( Clone , Copy , Eq , PartialEq , Debug ) ]
146143pub enum StackPopUnwind {
147144 /// The cleanup block.
148145 Cleanup ( mir:: BasicBlock ) ,
@@ -152,7 +149,7 @@ pub enum StackPopUnwind {
152149 NotAllowed ,
153150}
154151
155- #[ derive( Clone , Copy , Eq , PartialEq , Debug , HashStable ) ] // Miri debug-prints these
152+ #[ derive( Clone , Copy , Eq , PartialEq , Debug ) ] // Miri debug-prints these
156153pub enum StackPopCleanup {
157154 /// Jump to the next block in the caller, or cause UB if None (that's a function
158155 /// that may never return). Also store layout of return place so
@@ -168,16 +165,15 @@ pub enum StackPopCleanup {
168165}
169166
170167/// State of a local variable including a memoized layout
171- #[ derive( Clone , Debug , PartialEq , Eq , HashStable ) ]
168+ #[ derive( Clone , Debug ) ]
172169pub struct LocalState < ' tcx , Tag : Provenance = AllocId > {
173170 pub value : LocalValue < Tag > ,
174171 /// Don't modify if `Some`, this is only used to prevent computing the layout twice
175- #[ stable_hasher( ignore) ]
176172 pub layout : Cell < Option < TyAndLayout < ' tcx > > > ,
177173}
178174
179175/// 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
181177pub enum LocalValue < Tag : Provenance = AllocId > {
182178 /// This local is not currently alive, and cannot be used at all.
183179 Dead ,
@@ -678,7 +674,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
678674 body,
679675 loc : Err ( body. span ) , // Span used for errors caused during preamble.
680676 return_to_block,
681- return_place : * return_place,
677+ return_place : return_place. clone ( ) ,
682678 // empty local array, we fill it in below, after we are inside the stack frame and
683679 // all methods actually know about the frame
684680 locals : IndexVec :: new ( ) ,
@@ -799,7 +795,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
799795 let op = self
800796 . local_to_op ( self . frame ( ) , mir:: RETURN_PLACE , None )
801797 . expect ( "return place should always be live" ) ;
802- let dest = self . frame ( ) . return_place ;
798+ let dest = self . frame ( ) . return_place . clone ( ) ;
803799 let err = self . copy_op ( & op, & dest, /*allow_transmute*/ true ) ;
804800 trace ! ( "return value: {:?}" , self . dump_place( * dest) ) ;
805801 // 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
10211017 }
10221018 }
10231019}
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