Skip to content

Commit f168adf

Browse files
committed
make sure we do not copy unsized data
1 parent 1114ab6 commit f168adf

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)