Skip to content

Commit ca51b49

Browse files
committed
rustc: Replace the redundant typeck::node_ann_ty_params() with ty::ann_to_type_params()
1 parent 3aaf02b commit ca51b49

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

src/comp/middle/trans.rs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,24 +3287,6 @@ fn node_ann_type(&@crate_ctxt cx, &ast::ann a) -> ty::t {
32873287
ret target_type(cx, ty::ann_to_monotype(cx.tcx, cx.node_types, a));
32883288
}
32893289

3290-
fn node_ann_ty_params(&ast::ann a) -> vec[ty::t] {
3291-
alt (a) {
3292-
case (ast::ann_none(_)) {
3293-
log_err "missing type annotation";
3294-
fail;
3295-
}
3296-
case (ast::ann_type(_, _, ?tps_opt, _)) {
3297-
alt (tps_opt) {
3298-
case (none[vec[ty::t]]) {
3299-
log_err "type annotation has no ty params";
3300-
fail;
3301-
}
3302-
case (some[vec[ty::t]](?tps)) { ret tps; }
3303-
}
3304-
}
3305-
}
3306-
}
3307-
33083290
fn node_type(&@crate_ctxt cx, &ast::ann a) -> TypeRef {
33093291
ret type_of(cx, node_ann_type(cx, a));
33103292
}
@@ -4151,7 +4133,8 @@ fn trans_pat_match(&@block_ctxt cx, &@ast::pat pat, ValueRef llval,
41514133
C_int(variant_tag));
41524134
cx.build.CondBr(lleq, matched_cx.llbb, next_cx.llbb);
41534135

4154-
auto ty_params = node_ann_ty_params(ann);
4136+
auto ty_params = ty::ann_to_type_params(cx.fcx.lcx.ccx.node_types,
4137+
ann);
41554138

41564139
if (_vec::len[@ast::pat](subpats) > 0u) {
41574140
auto llblobptr = matched_cx.build.GEP(lltagptr,
@@ -4215,7 +4198,8 @@ fn trans_pat_binding(&@block_ctxt cx, &@ast::pat pat,
42154198
T_opaque_tag_ptr(cx.fcx.lcx.ccx.tn));
42164199
auto llblobptr = cx.build.GEP(lltagptr, vec(C_int(0), C_int(1)));
42174200

4218-
auto ty_param_substs = node_ann_ty_params(ann);
4201+
auto ty_param_substs =
4202+
ty::ann_to_type_params(cx.fcx.lcx.ccx.node_types, ann);
42194203

42204204
auto this_cx = cx;
42214205
auto i = 0;

0 commit comments

Comments
 (0)