Skip to content

Commit c6c4ba7

Browse files
committed
---
yaml --- r: 2218 b: refs/heads/master c: da328b1 h: refs/heads/master v: v3
1 parent ec2ec7c commit c6c4ba7

File tree

3 files changed

+184
-73
lines changed

3 files changed

+184
-73
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: 3f77e7df6dc2eabd47f3708cacc4124d43e79c77
2+
refs/heads/master: da328b1ba951bf2dbeb188120ab6344115a28631

trunk/src/comp/middle/trans.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ type local_ctxt = rec(vec[str] path,
120120
vec[ast.ty_param] obj_typarams,
121121
vec[ast.obj_field] obj_fields,
122122
@crate_ctxt ccx);
123-
123+
124124

125125
type self_vt = rec(ValueRef v, ty.t t);
126126

@@ -1565,7 +1565,7 @@ fn get_tydesc(&@block_ctxt cx, ty.t t) -> result {
15651565
// Does it contain a type param? If so, generate a derived tydesc.
15661566
let uint n_params = ty.count_ty_params(cx.fcx.lcx.ccx.tcx, t);
15671567

1568-
if (ty.count_ty_params(cx.fcx.lcx.ccx.tcx, t) > 0u) {
1568+
if (n_params > 0u) {
15691569
auto tys = linearize_ty_params(cx, t);
15701570

15711571
check (n_params == _vec.len[uint](tys._0));
@@ -4312,7 +4312,8 @@ fn trans_bind_thunk(@local_ctxt cx,
43124312

43134313
if (out_arg.mode == ast.val) {
43144314
val = bcx.build.Load(val);
4315-
} else if (ty.count_ty_params(cx.ccx.tcx, out_arg.ty) > 0u) {
4315+
} else if (ty.type_contains_params(cx.ccx.tcx,
4316+
out_arg.ty)) {
43164317
check (out_arg.mode == ast.alias);
43174318
val = bcx.build.PointerCast(val, llout_arg_ty);
43184319
}
@@ -4325,7 +4326,7 @@ fn trans_bind_thunk(@local_ctxt cx,
43254326
case (none[@ast.expr]) {
43264327
let ValueRef passed_arg = llvm.LLVMGetParam(llthunk, a);
43274328

4328-
if (ty.count_ty_params(cx.ccx.tcx, out_arg.ty) > 0u) {
4329+
if (ty.type_contains_params(cx.ccx.tcx, out_arg.ty)) {
43294330
check (out_arg.mode == ast.alias);
43304331
passed_arg = bcx.build.PointerCast(passed_arg,
43314332
llout_arg_ty);
@@ -4593,7 +4594,7 @@ fn trans_arg_expr(@block_ctxt cx,
45934594
bcx = re.bcx;
45944595
}
45954596

4596-
if (ty.count_ty_params(cx.fcx.lcx.ccx.tcx, arg.ty) > 0u) {
4597+
if (ty.type_contains_params(cx.fcx.lcx.ccx.tcx, arg.ty)) {
45974598
auto lldestty = lldestty0;
45984599
if (arg.mode == ast.val) {
45994600
// FIXME: we'd prefer to use &&, but rustboot doesn't like it
@@ -4655,7 +4656,7 @@ fn trans_args(@block_ctxt cx,
46554656
if (ty.type_has_dynamic_size(cx.fcx.lcx.ccx.tcx, retty)) {
46564657
llargs += vec(bcx.build.PointerCast
46574658
(llretslot, T_typaram_ptr(cx.fcx.lcx.ccx.tn)));
4658-
} else if (ty.count_ty_params(cx.fcx.lcx.ccx.tcx, retty) != 0u) {
4659+
} else if (ty.type_contains_params(cx.fcx.lcx.ccx.tcx, retty)) {
46594660
// It's possible that the callee has some generic-ness somewhere in
46604661
// its return value -- say a method signature within an obj or a fn
46614662
// type deep in a structure -- which the caller has a concrete view

0 commit comments

Comments
 (0)