@@ -27,6 +27,7 @@ import middle::ty::pat_ty;
27
27
import middle:: ty:: path_to_str;
28
28
import middle:: ty:: struct;
29
29
import middle:: ty:: triv_ann;
30
+ import middle:: ty:: ty_param_substs_opt_and_ty;
30
31
import middle:: ty:: ty_to_str;
31
32
import middle:: ty:: type_is_integral;
32
33
import middle:: ty:: type_is_scalar;
@@ -177,8 +178,6 @@ fn ty_param_count_and_ty_for_def(&@fn_ctxt fcx, &ast::span sp, &ast::def defn)
177
178
}
178
179
}
179
180
180
- type ty_param_substs_opt_and_ty = tup ( option:: t[ vec[ ty:: t ] ] , ty:: t ) ;
181
-
182
181
// Instantiates the given path, which must refer to an item with the given
183
182
// number of type parameters and type.
184
183
fn instantiate_path ( & @fn_ctxt fcx , & ast:: path pth, & ty_param_count_and_ty tpt,
@@ -372,6 +371,15 @@ fn ast_ty_to_ty_crate(@crate_ctxt ccx, &@ast::ty ast_ty) -> ty::t {
372
371
ret ast_ty_to_ty( ccx. tcx, f, ast_ty) ;
373
372
}
374
373
374
+ // Writes a type parameter count and type pair into the node type table.
375
+ fn write_type( & @crate_ctxt cx, uint node_id,
376
+ & ty_param_substs_opt_and_ty tpot) {
377
+ _vec:: grow_set[ option:: t[ ty:: ty_param_substs_opt_and_ty] ] ( cx. node_types,
378
+ 0 u,
379
+ none[ ty_param_substs_opt_and_ty] ,
380
+ some[ ty_param_substs_opt_and_ty] ( tpot) ) ;
381
+ }
382
+
375
383
376
384
// Item collection - a pair of bootstrap passes:
377
385
//
@@ -813,9 +821,9 @@ mod Collect {
813
821
ty_params) ;
814
822
auto typ = e. cx. type_cache. get( id) . _1;
815
823
auto item = ast:: item_tag( i, variants_t, ty_params, id,
816
- ast:: ann_type( ast:: ann_tag( a) , typ,
817
- none[ vec[ ty:: t] ] ,
818
- none[ @ts_ann] ) ) ;
824
+ ast:: ann_type( ast:: ann_tag( a) , typ,
825
+ none[ vec[ ty:: t] ] ,
826
+ none[ @ts_ann] ) ) ;
819
827
ret @fold:: respan[ ast:: item_] ( sp, item) ;
820
828
}
821
829
@@ -3025,7 +3033,7 @@ fn check_crate(&ty::ctxt tcx, &@ast::crate crate) -> typecheck_result {
3025
3033
map:: mk_hashmap[ unify_cache_entry, ty:: Unify :: result] ( hasher, eqer) ;
3026
3034
auto fpt =
3027
3035
mk_fn_purity_table ( crate ) ; // use a variation on Collect
3028
- let node_type_table node_types = vec ( ) ;
3036
+ let node_type_table node_types = vec ( mutable ) ;
3029
3037
3030
3038
auto ccx = @rec ( sess=sess,
3031
3039
type_cache=result. _1 ,
0 commit comments