Skip to content

Commit 1efd62a

Browse files
committed
---
yaml --- r: 1349 b: refs/heads/master c: 2f25d9c h: refs/heads/master i: 1347: b9613ad v: v3
1 parent 6204412 commit 1efd62a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
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: 74f71d387eceb4235bae89a400292ad6ecde8ca1
2+
refs/heads/master: 2f25d9c983c5730d79cc14278e666b8eb6531b10

trunk/src/comp/middle/trans.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,6 +2710,14 @@ fn trans_args(@block_ctxt cx,
27102710
}
27112711
if (ty.type_has_dynamic_size(retty)) {
27122712
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)));
27132721
} else {
27142722
llargs += llretslot;
27152723
}

0 commit comments

Comments
 (0)