@@ -652,9 +652,7 @@ where
652
652
M :: after_local_write ( self , local, /*storage_live*/ false ) ?;
653
653
}
654
654
// Double-check that the value we are storing and the local fit to each other.
655
- if cfg ! ( debug_assertions) {
656
- src. assert_matches_abi ( local_layout. abi , self ) ;
657
- }
655
+ src. assert_matches_abi ( local_layout. abi , self ) ;
658
656
}
659
657
Left ( mplace) => {
660
658
self . write_immediate_to_mplace_no_validate ( src, mplace. layout , mplace. mplace ) ?;
@@ -672,9 +670,8 @@ where
672
670
layout : TyAndLayout < ' tcx > ,
673
671
dest : MemPlace < M :: Provenance > ,
674
672
) -> InterpResult < ' tcx > {
675
- if cfg ! ( debug_assertions) {
676
- value. assert_matches_abi ( layout. abi , self ) ;
677
- }
673
+ // Ensure the value matches the type of the place it is written to.
674
+ value. assert_matches_abi ( layout. abi , self ) ;
678
675
// Note that it is really important that the type here is the right one, and matches the
679
676
// type things are read at. In case `value` is a `ScalarPair`, we don't do any magic here
680
677
// to handle padding properly, which is only correct if we never look at this data with the
0 commit comments