@@ -3287,24 +3287,6 @@ fn node_ann_type(&@crate_ctxt cx, &ast::ann a) -> ty::t {
3287
3287
ret target_type( cx, ty:: ann_to_monotype( cx. tcx, cx. node_types, a) ) ;
3288
3288
}
3289
3289
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
-
3308
3290
fn node_type( & @crate_ctxt cx, & ast:: ann a) -> TypeRef {
3309
3291
ret type_of( cx, node_ann_type( cx, a) ) ;
3310
3292
}
@@ -4151,7 +4133,8 @@ fn trans_pat_match(&@block_ctxt cx, &@ast::pat pat, ValueRef llval,
4151
4133
C_int ( variant_tag) ) ;
4152
4134
cx. build. CondBr ( lleq, matched_cx. llbb, next_cx. llbb) ;
4153
4135
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) ;
4155
4138
4156
4139
if ( _vec:: len[ @ast:: pat] ( subpats) > 0 u) {
4157
4140
auto llblobptr = matched_cx. build. GEP ( lltagptr,
@@ -4215,7 +4198,8 @@ fn trans_pat_binding(&@block_ctxt cx, &@ast::pat pat,
4215
4198
T_opaque_tag_ptr ( cx. fcx. lcx. ccx. tn) ) ;
4216
4199
auto llblobptr = cx. build. GEP ( lltagptr, vec( C_int ( 0 ) , C_int ( 1 ) ) ) ;
4217
4200
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) ;
4219
4203
4220
4204
auto this_cx = cx;
4221
4205
auto i = 0 ;
0 commit comments