diff options
| author | Graydon Hoare <[email protected]> | 2011-02-08 17:05:53 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-02-08 17:05:53 -0800 |
| commit | 2f25d9c983c5730d79cc14278e666b8eb6531b10 (patch) | |
| tree | 278091bbe46894e5a3862016de6d210d54b4f52c /src | |
| parent | Overhaul ABI. All retptrs, all the time. (diff) | |
| download | rust-2f25d9c983c5730d79cc14278e666b8eb6531b10.tar.xz rust-2f25d9c983c5730d79cc14278e666b8eb6531b10.zip | |
Handle subtle view-shift on outptr in generic calls. Can construct generic objs now.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/middle/trans.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 9e59cf57..4401f885 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -2710,6 +2710,14 @@ fn trans_args(@block_ctxt cx, } if (ty.type_has_dynamic_size(retty)) { llargs += cx.build.PointerCast(llretslot, T_typaram_ptr()); + } else if (ty.count_ty_params(retty) != 0u) { + // It's possible that the callee has some generic-ness somewhere in + // its return value -- say a method signature within an obj or a fn + // type deep in a structure -- which the caller has a concrete view + // of. If so, cast the caller's view of the restlot to the callee's + // view, for the sake of making a type-compatible call. + llargs += cx.build.PointerCast(llretslot, + T_ptr(type_of(cx.fcx.ccx, retty))); } else { llargs += llretslot; } |