aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-03-18 18:45:49 -0700
committerPatrick Walton <[email protected]>2011-03-18 18:45:49 -0700
commite6b6d1b64589e077a8ba6e8c752eabd3cfec6755 (patch)
tree69359584654921a058485100a91c6be11483f726 /src
parentrustc: Make iter_structural_ty_full() generic-safe wrt tags (diff)
downloadrust-e6b6d1b64589e077a8ba6e8c752eabd3cfec6755.tar.xz
rust-e6b6d1b64589e077a8ba6e8c752eabd3cfec6755.zip
rustc: Make trans_path() generic-safe wrt nullary tags
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/trans.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index e0d38140..8bbd9fa2 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -3441,8 +3441,15 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
auto alloc_result = alloc_ty(cx, tag_ty);
auto lltagblob = alloc_result.val;
+
+ auto lltagty;
+ if (ty.type_has_dynamic_size(tag_ty)) {
+ lltagty = T_opaque_tag(cx.fcx.ccx.tn);
+ } else {
+ lltagty = type_of(cx.fcx.ccx, tag_ty);
+ }
auto lltagptr = alloc_result.bcx.build.PointerCast(
- lltagblob, T_ptr(type_of(cx.fcx.ccx, tag_ty)));
+ lltagblob, T_ptr(lltagty));
auto lldiscrimptr = alloc_result.bcx.build.GEP(
lltagptr, vec(C_int(0), C_int(0)));