Skip to content

Commit 533dea7

Browse files
committed
rustc: Move type_of() behind the check for dynamic size in trans_vec()
1 parent 78bcfe2 commit 533dea7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4178,7 +4178,6 @@ fn trans_vec(@block_ctxt cx, vec[@ast.expr] args,
41784178
}
41794179
}
41804180

4181-
auto llunit_ty = type_of(cx.fcx.ccx, unit_ty);
41824181
auto bcx = cx;
41834182
auto unit_sz = size_of(bcx, unit_ty);
41844183
bcx = unit_sz.bcx;
@@ -4222,6 +4221,7 @@ fn trans_vec(@block_ctxt cx, vec[@ast.expr] args,
42224221

42234222
auto dst_val;
42244223
if (!ty.type_has_dynamic_size(unit_ty)) {
4224+
auto llunit_ty = type_of(cx.fcx.ccx, unit_ty);
42254225
dst_val = bcx.build.PointerCast(dst_res.val, T_ptr(llunit_ty));
42264226
} else {
42274227
dst_val = dst_res.val;

0 commit comments

Comments
 (0)