aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle/ty.rs
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-05-13 13:05:55 -0700
committerPatrick Walton <[email protected]>2011-05-13 13:06:34 -0700
commitc97b05141ab6bf5410d55d8a879690ca6d51d667 (patch)
treecade1a0a0b2f8d953c2d155ba304c274b89e5b12 /src/comp/middle/ty.rs
parentRemove reserved word tests (since reserved words were removed) (diff)
downloadrust-c97b05141ab6bf5410d55d8a879690ca6d51d667.tar.xz
rust-c97b05141ab6bf5410d55d8a879690ca6d51d667.zip
rustc: Add write_type() wherever ann_types are written, except for triv_ann()
Diffstat (limited to 'src/comp/middle/ty.rs')
-rw-r--r--src/comp/middle/ty.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index 388eed21..b3d9977e 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -163,7 +163,8 @@ type type_store = rec(mutable vec[raw_t] others,
hashmap[raw_t,uint] other_structural);
type ty_param_substs_opt_and_ty = tup(option::t[vec[ty::t]], ty::t);
-type node_type_table = vec[mutable option::t[ty::ty_param_substs_opt_and_ty]];
+type node_type_table =
+ @mutable vec[mutable option::t[ty::ty_param_substs_opt_and_ty]];
fn mk_type_store() -> @type_store {
let vec[raw_t] others = vec();
@@ -1469,6 +1470,18 @@ fn ann_to_type_params(&node_type_table ntt, &ast::ann ann) -> vec[t] {
}
}
+fn ann_to_ty_param_substs_opt_and_ty(&node_type_table ntt, &ast::ann ann)
+ -> ty_param_substs_opt_and_ty {
+ alt (ann) {
+ case (ast::ann_none(_)) {
+ log_err "ann_to_ty_param_substs_opt_and_ty() called on a node " +
+ "with no type params";
+ fail;
+ }
+ case (ast::ann_type(_, ?t, ?tps, _)) { ret tup(tps, t); }
+ }
+}
+
// Returns the type of an annotation, with type parameter substitutions
// performed if applicable.
fn ann_to_monotype(ctxt cx, &node_type_table ntt, ast::ann a) -> t {