rustc: Don't try to load dynamically-sized types when translating tag variants. Add a test case for this.
This commit is contained in:
parent
02f669ca67
commit
fcd195bb4c
2 changed files with 9 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
7
src/test/run-pass/simple-generic-tag.rs
Normal file
7
src/test/run-pass/simple-generic-tag.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
tag clam[T] {
|
||||
a(T);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue