Skip to content

Commit 7878cff

Browse files
committed
---
yaml --- r: 2511 b: refs/heads/master c: be9aa1c h: refs/heads/master i: 2509: 63d3bcb 2507: 43b0446 2503: c05bf7e 2495: b39f66b v: v3
1 parent 2107922 commit 7878cff

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
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: 6e34679a65cf0e811567f7416b8cebc4e2a05749
2+
refs/heads/master: be9aa1cc5ecb59c62a80db9e5be355deac90d08e

trunk/src/comp/middle/ty.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ const uint idx_first_others = 20u;
162162
type type_store = rec(mutable vec[raw_t] others,
163163
hashmap[raw_t,uint] other_structural);
164164

165-
type node_type_table = vec[ty::ty_param_count_and_ty];
165+
type ty_param_substs_opt_and_ty = tup(option::t[vec[ty::t]], ty::t);
166+
type node_type_table = vec[mutable option::t[ty::ty_param_substs_opt_and_ty]];
166167

167168
fn mk_type_store() -> @type_store {
168169
let vec[raw_t] others = vec();

trunk/src/comp/middle/typeck.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import middle::ty::pat_ty;
2727
import middle::ty::path_to_str;
2828
import middle::ty::struct;
2929
import middle::ty::triv_ann;
30+
import middle::ty::ty_param_substs_opt_and_ty;
3031
import middle::ty::ty_to_str;
3132
import middle::ty::type_is_integral;
3233
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)
177178
}
178179
}
179180

180-
type ty_param_substs_opt_and_ty = tup(option::t[vec[ty::t]], ty::t);
181-
182181
// Instantiates the given path, which must refer to an item with the given
183182
// number of type parameters and type.
184183
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 {
372371
ret ast_ty_to_ty(ccx.tcx, f, ast_ty);
373372
}
374373

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+
0u,
379+
none[ty_param_substs_opt_and_ty],
380+
some[ty_param_substs_opt_and_ty](tpot));
381+
}
382+
375383

376384
// Item collection - a pair of bootstrap passes:
377385
//
@@ -813,9 +821,9 @@ mod Collect {
813821
ty_params);
814822
auto typ = e.cx.type_cache.get(id)._1;
815823
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]));
819827
ret @fold::respan[ast::item_](sp, item);
820828
}
821829

@@ -3025,7 +3033,7 @@ fn check_crate(&ty::ctxt tcx, &@ast::crate crate) -> typecheck_result {
30253033
map::mk_hashmap[unify_cache_entry,ty::Unify::result](hasher, eqer);
30263034
auto fpt =
30273035
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);
30293037

30303038
auto ccx = @rec(sess=sess,
30313039
type_cache=result._1,

0 commit comments

Comments
 (0)