Skip to content

Commit

Permalink
make sure we do not copy unsized data
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 1, 2018
1 parent 1114ab6 commit f168adf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_mir/interpret/place.rs
Expand Up @@ -622,6 +622,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
src: OpTy<'tcx>,
dest: PlaceTy<'tcx>,
) -> EvalResult<'tcx> {
assert!(!src.layout.is_unsized() && !dest.layout.is_unsized(),
"Cannot copy unsized data");
assert_eq!(src.layout.size, dest.layout.size,
"Size mismatch when copying!\nsrc: {:#?}\ndest: {:#?}", src, dest);

Expand Down

0 comments on commit f168adf

Please sign in to comment.