This commit is contained in:
Oliver Scherer 2018-11-16 11:48:48 +01:00
parent a5ef2d1b54
commit cb8fa33572

View File

@ -659,7 +659,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
self.check_align(src, src_align)?;
self.check_align(dest, dest_align)?;
if size.bytes() == 0 {
// Nothing to do for ZST, other than checking alignment and non-NULLness which already happened.
// Nothing to do for ZST, other than checking alignment and
// non-NULLness which already happened.
return Ok(());
}
let src = src.to_ptr()?;