Skip to content

Commit fcd195b

Browse files
committed
rustc: Don't try to load dynamically-sized types when translating tag variants. Add a test case for this.
1 parent 02f669c commit fcd195b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/comp/middle/trans.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4920,7 +4920,8 @@ fn trans_tag_variant(@crate_ctxt cx, ast.def_id tag_id,
49204920

49214921
auto arg_ty = arg_tys.(i).ty;
49224922
auto llargval;
4923-
if (ty.type_is_structural(arg_ty)) {
4923+
if (ty.type_is_structural(arg_ty) ||
4924+
ty.type_has_dynamic_size(arg_ty)) {
49244925
llargval = llargptr;
49254926
} else {
49264927
llargval = bcx.build.Load(llargptr);
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tag clam[T] {
2+
a(T);
3+
}
4+
5+
fn main() {
6+
}
7+

0 commit comments

Comments
 (0)