Skip to content

Commit 55484f7

Browse files
msullivanbrson
authored andcommitted
---
yaml --- r: 3800 b: refs/heads/master c: 0beb271 h: refs/heads/master v: v3
1 parent b13c3ab commit 55484f7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 15a670a1b1b43991679b17c14eb5d188058f708a
2+
refs/heads/master: 0beb271d8c74618a0b423c80692c0a2bc070b014

trunk/src/comp/middle/trans.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5525,8 +5525,12 @@ fn trans_bind_thunk(&@local_ctxt cx, &span sp, &ty::t incoming_fty,
55255525
bcx = copy_ty(bcx, val, e_ty).bcx;
55265526
val = bcx.build.Load(val);
55275527
}
5528-
} else if (ty::type_contains_params(cx.ccx.tcx, out_arg.ty)) {
5529-
assert (out_arg.mode != ty::mo_val);
5528+
}
5529+
// If the type is parameterized, then we need to cast the
5530+
// type we actually have to the parameterized out type.
5531+
if (ty::type_contains_params(cx.ccx.tcx, out_arg.ty)) {
5532+
// FIXME: (#642) This works for boxes and alias params
5533+
// but does not work for bare functions.
55305534
val = bcx.build.PointerCast(val, llout_arg_ty);
55315535
}
55325536
llargs += ~[val];

0 commit comments

Comments
 (0)