@@ -773,22 +773,6 @@ where
773
773
interp_ok ( ( ) )
774
774
}
775
775
776
- /// Copies the data from an operand to a place.
777
- /// The layouts of the `src` and `dest` may disagree.
778
- /// Does not perform validation of the destination.
779
- /// The only known use case for this function is checking the return
780
- /// value of a static during stack frame popping.
781
- #[ inline( always) ]
782
- pub ( super ) fn copy_op_no_dest_validation (
783
- & mut self ,
784
- src : & impl Projectable < ' tcx , M :: Provenance > ,
785
- dest : & impl Writeable < ' tcx , M :: Provenance > ,
786
- ) -> InterpResult < ' tcx > {
787
- self . copy_op_inner (
788
- src, dest, /* allow_transmute */ true , /* validate_dest */ false ,
789
- )
790
- }
791
-
792
776
/// Copies the data from an operand to a place.
793
777
/// The layouts of the `src` and `dest` may disagree.
794
778
#[ inline( always) ]
@@ -797,9 +781,7 @@ where
797
781
src : & impl Projectable < ' tcx , M :: Provenance > ,
798
782
dest : & impl Writeable < ' tcx , M :: Provenance > ,
799
783
) -> InterpResult < ' tcx > {
800
- self . copy_op_inner (
801
- src, dest, /* allow_transmute */ true , /* validate_dest */ true ,
802
- )
784
+ self . copy_op_inner ( src, dest, /* allow_transmute */ true )
803
785
}
804
786
805
787
/// Copies the data from an operand to a place.
@@ -810,9 +792,7 @@ where
810
792
src : & impl Projectable < ' tcx , M :: Provenance > ,
811
793
dest : & impl Writeable < ' tcx , M :: Provenance > ,
812
794
) -> InterpResult < ' tcx > {
813
- self . copy_op_inner (
814
- src, dest, /* allow_transmute */ false , /* validate_dest */ true ,
815
- )
795
+ self . copy_op_inner ( src, dest, /* allow_transmute */ false )
816
796
}
817
797
818
798
/// Copies the data from an operand to a place.
@@ -824,22 +804,21 @@ where
824
804
src : & impl Projectable < ' tcx , M :: Provenance > ,
825
805
dest : & impl Writeable < ' tcx , M :: Provenance > ,
826
806
allow_transmute : bool ,
827
- validate_dest : bool ,
828
807
) -> InterpResult < ' tcx > {
829
808
// These are technically *two* typed copies: `src` is a not-yet-loaded value,
830
- // so we're going a typed copy at `src` type from there to some intermediate storage.
809
+ // so we're doing a typed copy at `src` type from there to some intermediate storage.
831
810
// And then we're doing a second typed copy from that intermediate storage to `dest`.
832
811
// But as an optimization, we only make a single direct copy here.
833
812
834
813
// Do the actual copy.
835
814
self . copy_op_no_validate ( src, dest, allow_transmute) ?;
836
815
837
- if validate_dest && M :: enforce_validity ( self , dest. layout ( ) ) {
816
+ if M :: enforce_validity ( self , dest. layout ( ) ) {
838
817
let dest = dest. to_place ( ) ;
839
818
// Given that there were two typed copies, we have to ensure this is valid at both types,
840
819
// and we have to ensure this loses provenance and padding according to both types.
841
820
// But if the types are identical, we only do one pass.
842
- if allow_transmute && src. layout ( ) . ty != dest. layout ( ) . ty {
821
+ if src. layout ( ) . ty != dest. layout ( ) . ty {
843
822
self . validate_operand (
844
823
& dest. transmute ( src. layout ( ) , self ) ?,
845
824
M :: enforce_validity_recursively ( self , src. layout ( ) ) ,
0 commit comments