Skip to content

Commit 49b3cd7

Browse files
committed
rustc: Remove the premature optimization for nullary tag constructors, since it'll be no longer necessary once LLVM gets a unit type
1 parent a439f6e commit 49b3cd7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/comp/middle/trans.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type glue_fns = rec(ValueRef activate_glue,
4444
ValueRef exit_task_glue,
4545
vec[ValueRef] upcall_glues);
4646

47-
tag arity { nullary; n_ary(uint); }
47+
tag arity { nullary; n_ary; }
4848
type tag_info = rec(type_handle th,
4949
mutable vec[tup(ast.def_id,arity)] variants);
5050

@@ -1141,7 +1141,7 @@ fn trans_name(@block_ctxt cx, &ast.name n, &option.t[ast.def] dopt)
11411141
auto elems = vec(C_int(i));
11421142
ret tup(res(cx, C_struct(elems)), false);
11431143
}
1144-
case (n_ary(_)) {
1144+
case (n_ary) {
11451145
cx.fcx.ccx.sess.unimpl("n-ary tag " +
11461146
"constructor in " +
11471147
"trans");
@@ -1746,10 +1746,9 @@ fn resolve_tag_types_for_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt {
17461746
}
17471747

17481748
variant_tys += vec(T_struct(lltys));
1749-
1750-
arity_info = n_ary(n_ary_idx);
1751-
n_ary_idx += 1u;
1749+
arity_info = n_ary;
17521750
} else {
1751+
variant_tys += vec(T_nil());
17531752
arity_info = nullary;
17541753
}
17551754

0 commit comments

Comments
 (0)