Skip to content

Commit 7550667

Browse files
committed
---
yaml --- r: 2103 b: refs/heads/master c: 65b7578 h: refs/heads/master i: 2101: e3aa71d 2099: 064435a 2095: 2b1f055 v: v3
1 parent 9872963 commit 7550667

File tree

6 files changed

+549
-359
lines changed

6 files changed

+549
-359
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: ec5a60d5e26c9d38755e66660d7913e42f42a1b3
2+
refs/heads/master: 65b75788517ad797c1ae86f9d0c550ec620c4dfc

trunk/src/comp/middle/trans.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,10 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t, bool boxed) -> TypeRef {
742742
case (ty.ty_param(_)) {
743743
llty = T_i8();
744744
}
745+
case (ty.ty_bound_param(_)) {
746+
log "ty_bound_param in trans.type_of";
747+
fail;
748+
}
745749
case (ty.ty_type) { llty = T_ptr(T_tydesc(cx.tn)); }
746750
}
747751

@@ -1144,6 +1148,7 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
11441148
auto tup_ty = ty.plain_tup_ty(args);
11451149

11461150
// Perform any type parameter substitutions.
1151+
tup_ty = ty.bind_params_in_type(tup_ty);
11471152
tup_ty = ty.substitute_type_params(subtys, tup_ty);
11481153

11491154
// Here we possibly do a recursive call.
@@ -1216,7 +1221,8 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
12161221
let vec[@ty.t] raw_tys = variant.args;
12171222
let vec[@ty.t] tys = vec();
12181223
for (@ty.t raw_ty in raw_tys) {
1219-
auto t = ty.substitute_type_params(tps, raw_ty);
1224+
auto t = ty.bind_params_in_type(raw_ty);
1225+
t = ty.substitute_type_params(tps, t);
12201226
tys += vec(t);
12211227
}
12221228

@@ -1390,7 +1396,8 @@ fn GEP_tag(@block_ctxt cx,
13901396
auto i = 0;
13911397
let vec[@ty.t] true_arg_tys = vec();
13921398
for (@ty.t aty in arg_tys) {
1393-
auto arg_ty = ty.substitute_type_params(ty_substs, aty);
1399+
auto arg_ty = ty.bind_params_in_type(aty);
1400+
arg_ty = ty.substitute_type_params(ty_substs, arg_ty);
13941401
true_arg_tys += vec(arg_ty);
13951402
if (i == ix) {
13961403
elem_ty = arg_ty;
@@ -2118,8 +2125,9 @@ fn iter_structural_ty_full(@block_ctxt cx,
21182125
auto llfldp_b = rslt.val;
21192126
variant_cx = rslt.bcx;
21202127

2121-
auto ty_subst =
2122-
ty.substitute_type_params(tps, a.ty);
2128+
auto ty_subst = ty.bind_params_in_type(a.ty);
2129+
ty_subst =
2130+
ty.substitute_type_params(tps, ty_subst);
21232131

21242132
auto llfld_a =
21252133
load_if_immediate(variant_cx,
@@ -2501,15 +2509,10 @@ fn target_type(@crate_ctxt cx, @ty.t t) -> @ty.t {
25012509
ret t;
25022510
}
25032511

2512+
2513+
// Converts an annotation to a type
25042514
fn node_ann_type(@crate_ctxt cx, &ast.ann a) -> @ty.t {
2505-
alt (a) {
2506-
case (ast.ann_none) {
2507-
cx.sess.bug("missing type annotation");
2508-
}
2509-
case (ast.ann_type(?t, _, _)) {
2510-
ret target_type(cx, t);
2511-
}
2512-
}
2515+
ret target_type(cx, ty.ann_to_monotype(a));
25132516
}
25142517

25152518
fn node_ann_ty_params(&ast.ann a) -> vec[@ty.t] {

0 commit comments

Comments
 (0)