Skip to content

Commit c97acc3

Browse files
committed
Auto merge of #27944 - dotdash:zst_memcpy, r=eddyb
r? @eddyb
2 parents 2375743 + e75abd3 commit c97acc3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc_trans/trans/base.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,11 @@ pub fn memcpy_ty<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
956956
t: Ty<'tcx>) {
957957
let _icx = push_ctxt("memcpy_ty");
958958
let ccx = bcx.ccx();
959+
960+
if type_is_zero_size(ccx, t) {
961+
return;
962+
}
963+
959964
if t.is_structural() {
960965
let llty = type_of::type_of(ccx, t);
961966
let llsz = llsize_of(ccx, llty);

0 commit comments

Comments
 (0)