@@ -9,7 +9,7 @@ use std::fmt::Write;
99use std:: sync:: atomic:: AtomicBool ;
1010use std:: { cmp, mem} ;
1111
12- use rustc_abi:: { BackendRepr , Size } ;
12+ use rustc_abi:: Size ;
1313use rustc_data_structures:: fx:: FxHashSet ;
1414use rustc_middle:: mir:: { Mutability , RetagKind } ;
1515use rustc_middle:: ty:: layout:: HasTypingEnv ;
@@ -887,22 +887,19 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
887887 place : & PlaceTy < ' tcx > ,
888888 ) -> InterpResult < ' tcx > {
889889 let this = self . eval_context_mut ( ) ;
890- let retag_fields = this. machine . borrow_tracker . as_mut ( ) . unwrap ( ) . get_mut ( ) . retag_fields ;
891890 let retag_cause = match kind {
892891 RetagKind :: TwoPhase => unreachable ! ( ) , // can only happen in `retag_ptr_value`
893892 RetagKind :: FnEntry => RetagCause :: FnEntry ,
894893 RetagKind :: Default | RetagKind :: Raw => RetagCause :: Normal ,
895894 } ;
896- let mut visitor =
897- RetagVisitor { ecx : this, kind, retag_cause, retag_fields, in_field : false } ;
895+ let mut visitor = RetagVisitor { ecx : this, kind, retag_cause, in_field : false } ;
898896 return visitor. visit_value ( place) ;
899897
900898 // The actual visitor.
901899 struct RetagVisitor < ' ecx , ' tcx > {
902900 ecx : & ' ecx mut MiriInterpCx < ' tcx > ,
903901 kind : RetagKind ,
904902 retag_cause : RetagCause ,
905- retag_fields : RetagFields ,
906903 in_field : bool ,
907904 }
908905 impl < ' ecx , ' tcx > RetagVisitor < ' ecx , ' tcx > {
@@ -967,24 +964,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
967964 self . walk_value ( place) ?;
968965 }
969966 _ => {
970- // Not a reference/pointer/box. Only recurse if configured appropriately.
971- let recurse = match self . retag_fields {
972- RetagFields :: No => false ,
973- RetagFields :: Yes => true ,
974- RetagFields :: OnlyScalar => {
975- // Matching `ArgAbi::new` at the time of writing, only fields of
976- // `Scalar` and `ScalarPair` ABI are considered.
977- matches ! (
978- place. layout. backend_repr,
979- BackendRepr :: Scalar ( ..) | BackendRepr :: ScalarPair ( ..)
980- )
981- }
982- } ;
983- if recurse {
984- let in_field = mem:: replace ( & mut self . in_field , true ) ; // remember and restore old value
985- self . walk_value ( place) ?;
986- self . in_field = in_field;
987- }
967+ // Not a reference/pointer/box. Recurse.
968+ let in_field = mem:: replace ( & mut self . in_field , true ) ; // remember and restore old value
969+ self . walk_value ( place) ?;
970+ self . in_field = in_field;
988971 }
989972 }
990973
0 commit comments