Skip to content

Commit 3234f01

Browse files
committed
---
yaml --- r: 1351 b: refs/heads/master c: 8c0d350 h: refs/heads/master i: 1349: 1efd62a 1347: b9613ad 1343: 213144a v: v3
1 parent 49ee448 commit 3234f01

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
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: 467a628ffaf41844a90e6664c2ecd481eef1dc85
2+
refs/heads/master: 8c0d35066bcc0ab0eb35818f4de63bccee097e5c

trunk/src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ TEST_XFAILS_RUSTC := $(filter-out \
455455
generic-fn.rs \
456456
generic-fn-infer.rs \
457457
generic-drop-glue.rs \
458+
generic-obj.rs \
458459
generic-tup.rs \
459460
generic-type.rs \
460461
hello.rs \

trunk/src/comp/middle/trans.rs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,15 @@ fn type_of_fn_full(@crate_ctxt cx,
399399
}
400400
}
401401

402-
// Args >3: ty params ...
403-
auto ty_param_count =
404-
ty.count_ty_params(plain_ty(ty.ty_fn(inputs, output)));
405-
auto i = 0u;
406-
while (i < ty_param_count) {
407-
atys += T_ptr(T_tydesc());
408-
i += 1u;
402+
// Args >3: ty params, if not acquired via capture...
403+
if (obj_self == none[TypeRef]) {
404+
auto ty_param_count =
405+
ty.count_ty_params(plain_ty(ty.ty_fn(inputs, output)));
406+
auto i = 0u;
407+
while (i < ty_param_count) {
408+
atys += T_ptr(T_tydesc());
409+
i += 1u;
410+
}
409411
}
410412

411413
// ... then explicit args.
@@ -3387,11 +3389,13 @@ fn create_llargs_for_fn_args(&@fn_ctxt cx,
33873389

33883390
auto arg_n = 3u;
33893391

3390-
for (ast.ty_param tp in ty_params) {
3391-
auto llarg = llvm.LLVMGetParam(cx.llfn, arg_n);
3392-
check (llarg as int != 0);
3393-
cx.lltydescs.insert(tp.id, llarg);
3394-
arg_n += 1u;
3392+
if (ty_self == none[TypeRef]) {
3393+
for (ast.ty_param tp in ty_params) {
3394+
auto llarg = llvm.LLVMGetParam(cx.llfn, arg_n);
3395+
check (llarg as int != 0);
3396+
cx.lltydescs.insert(tp.id, llarg);
3397+
arg_n += 1u;
3398+
}
33953399
}
33963400

33973401

0 commit comments

Comments
 (0)