We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74f71d3 commit 2f25d9cCopy full SHA for 2f25d9c
src/comp/middle/trans.rs
@@ -2710,6 +2710,14 @@ fn trans_args(@block_ctxt cx,
2710
}
2711
if (ty.type_has_dynamic_size(retty)) {
2712
llargs += cx.build.PointerCast(llretslot, T_typaram_ptr());
2713
+ } else if (ty.count_ty_params(retty) != 0u) {
2714
+ // It's possible that the callee has some generic-ness somewhere in
2715
+ // its return value -- say a method signature within an obj or a fn
2716
+ // type deep in a structure -- which the caller has a concrete view
2717
+ // of. If so, cast the caller's view of the restlot to the callee's
2718
+ // view, for the sake of making a type-compatible call.
2719
+ llargs += cx.build.PointerCast(llretslot,
2720
+ T_ptr(type_of(cx.fcx.ccx, retty)));
2721
} else {
2722
llargs += llretslot;
2723
0 commit comments