Skip to content

Commit c7fc1a5

Browse files
committed
Auto merge of #53883 - RalfJung:miri-assert, r=oli-obk
miri engine: make sure we do not copy unsized data r? @oli-obk
2 parents 0f063ae + f168adf commit c7fc1a5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_mir/interpret/place.rs

+2
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
622622
src: OpTy<'tcx>,
623623
dest: PlaceTy<'tcx>,
624624
) -> EvalResult<'tcx> {
625+
assert!(!src.layout.is_unsized() && !dest.layout.is_unsized(),
626+
"Cannot copy unsized data");
625627
assert_eq!(src.layout.size, dest.layout.size,
626628
"Size mismatch when copying!\nsrc: {:#?}\ndest: {:#?}", src, dest);
627629

0 commit comments

Comments
 (0)