Don't emit memcpy's for zero-sized types

This commit is contained in:
Björn Steinbrink 2015-08-22 17:07:37 +02:00
parent 3a407b6c4e
commit e75abd3438

@ -956,6 +956,11 @@ pub fn memcpy_ty<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
t: Ty<'tcx>) {
let _icx = push_ctxt("memcpy_ty");
let ccx = bcx.ccx();
if type_is_zero_size(ccx, t) {
return;
}
if t.is_structural() {
let llty = type_of::type_of(ccx, t);
let llsz = llsize_of(ccx, llty);