Elide passed-typarams when tydescs are captured. Un-XFAIL generic-obj.rs.

This commit is contained in:
Graydon Hoare
2011-02-09 09:54:58 -08:00
parent 467a628ffa
commit 8c0d35066b
2 changed files with 17 additions and 12 deletions

View File

@@ -455,6 +455,7 @@ TEST_XFAILS_RUSTC := $(filter-out \
generic-fn.rs \ generic-fn.rs \
generic-fn-infer.rs \ generic-fn-infer.rs \
generic-drop-glue.rs \ generic-drop-glue.rs \
generic-obj.rs \
generic-tup.rs \ generic-tup.rs \
generic-type.rs \ generic-type.rs \
hello.rs \ hello.rs \

View File

@@ -399,13 +399,15 @@ fn type_of_fn_full(@crate_ctxt cx,
} }
} }
// Args >3: ty params ... // Args >3: ty params, if not acquired via capture...
auto ty_param_count = if (obj_self == none[TypeRef]) {
ty.count_ty_params(plain_ty(ty.ty_fn(inputs, output))); auto ty_param_count =
auto i = 0u; ty.count_ty_params(plain_ty(ty.ty_fn(inputs, output)));
while (i < ty_param_count) { auto i = 0u;
atys += T_ptr(T_tydesc()); while (i < ty_param_count) {
i += 1u; atys += T_ptr(T_tydesc());
i += 1u;
}
} }
// ... then explicit args. // ... then explicit args.
@@ -3387,11 +3389,13 @@ fn create_llargs_for_fn_args(&@fn_ctxt cx,
auto arg_n = 3u; auto arg_n = 3u;
for (ast.ty_param tp in ty_params) { if (ty_self == none[TypeRef]) {
auto llarg = llvm.LLVMGetParam(cx.llfn, arg_n); for (ast.ty_param tp in ty_params) {
check (llarg as int != 0); auto llarg = llvm.LLVMGetParam(cx.llfn, arg_n);
cx.lltydescs.insert(tp.id, llarg); check (llarg as int != 0);
arg_n += 1u; cx.lltydescs.insert(tp.id, llarg);
arg_n += 1u;
}
} }