提交 0beb271d 编写于 作者: M Michael Sullivan 提交者: Brian Anderson

Fix bind to work with boxed arguments with type parameters.

This still doesn't work with bare fn arguments with type parameters.
上级 15a670a1
...@@ -5525,8 +5525,12 @@ fn trans_bind_thunk(&@local_ctxt cx, &span sp, &ty::t incoming_fty, ...@@ -5525,8 +5525,12 @@ fn trans_bind_thunk(&@local_ctxt cx, &span sp, &ty::t incoming_fty,
bcx = copy_ty(bcx, val, e_ty).bcx; bcx = copy_ty(bcx, val, e_ty).bcx;
val = bcx.build.Load(val); val = bcx.build.Load(val);
} }
} else if (ty::type_contains_params(cx.ccx.tcx, out_arg.ty)) { }
assert (out_arg.mode != ty::mo_val); // If the type is parameterized, then we need to cast the
// type we actually have to the parameterized out type.
if (ty::type_contains_params(cx.ccx.tcx, out_arg.ty)) {
// FIXME: (#642) This works for boxes and alias params
// but does not work for bare functions.
val = bcx.build.PointerCast(val, llout_arg_ty); val = bcx.build.PointerCast(val, llout_arg_ty);
} }
llargs += ~[val]; llargs += ~[val];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册