@@ -652,9 +652,7 @@ where
652652 M :: after_local_write ( self , local, /*storage_live*/ false ) ?;
653653 }
654654 // 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 ) ;
658656 }
659657 Left ( mplace) => {
660658 self . write_immediate_to_mplace_no_validate ( src, mplace. layout , mplace. mplace ) ?;
@@ -672,9 +670,8 @@ where
672670 layout : TyAndLayout < ' tcx > ,
673671 dest : MemPlace < M :: Provenance > ,
674672 ) -> 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 ) ;
678675 // Note that it is really important that the type here is the right one, and matches the
679676 // type things are read at. In case `value` is a `ScalarPair`, we don't do any magic here
680677 // to handle padding properly, which is only correct if we never look at this data with the
0 commit comments