rustc: Don't try to load dynamically-sized types when translating tag variants. Add a test case for this.

This commit is contained in:
Patrick Walton 2011-03-09 11:33:44 -08:00
parent 02f669ca67
commit fcd195bb4c
2 changed files with 9 additions and 1 deletions

View file

@ -4920,7 +4920,8 @@ fn trans_tag_variant(@crate_ctxt cx, ast.def_id tag_id,
auto arg_ty = arg_tys.(i).ty;
auto llargval;
if (ty.type_is_structural(arg_ty)) {
if (ty.type_is_structural(arg_ty) ||
ty.type_has_dynamic_size(arg_ty)) {
llargval = llargptr;
} else {
llargval = bcx.build.Load(llargptr);

View file

@ -0,0 +1,7 @@
tag clam[T] {
a(T);
}
fn main() {
}