aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-04-22 12:27:28 -0700
committerPatrick Walton <[email protected]>2011-04-22 12:27:52 -0700
commitc7473c8260cbe6892eeed82f275bf09a73895e0e (patch)
tree7575249a63b6467a6dde53f89e7a19720136bfee /src
parentUse -c in the Makefiles. (diff)
downloadrust-c7473c8260cbe6892eeed82f275bf09a73895e0e.tar.xz
rust-c7473c8260cbe6892eeed82f275bf09a73895e0e.zip
rustc: Switch @ty.t to ty.t so that we can change it to a uint
Diffstat (limited to 'src')
-rw-r--r--src/comp/front/ast.rs4
-rw-r--r--src/comp/front/creader.rs12
-rw-r--r--src/comp/middle/metadata.rs8
-rw-r--r--src/comp/middle/trans.rs304
-rw-r--r--src/comp/middle/ty.rs345
-rw-r--r--src/comp/middle/typeck.rs172
-rw-r--r--src/comp/util/common.rs2
7 files changed, 424 insertions, 423 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index 95522c0c..2fd13194 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -22,8 +22,8 @@ type ty_param = ident;
// Annotations added during successive passes.
tag ann {
ann_none;
- ann_type(@middle.ty.t,
- option.t[vec[@middle.ty.t]], /* ty param substs */
+ ann_type(middle.ty.t,
+ option.t[vec[middle.ty.t]], /* ty param substs */
option.t[@ts_ann]); /* pre- and postcondition for typestate */
}
diff --git a/src/comp/front/creader.rs b/src/comp/front/creader.rs
index e37b6913..857ed2d3 100644
--- a/src/comp/front/creader.rs
+++ b/src/comp/front/creader.rs
@@ -63,7 +63,7 @@ fn next(@pstate st) -> u8 {
ret ch as u8;
}
-fn parse_ty_str(str rep, str_def sd, @ty.type_store tystore) -> @ty.t {
+fn parse_ty_str(str rep, str_def sd, @ty.type_store tystore) -> ty.t {
auto len = _str.byte_len(rep);
auto st = @rec(rep=rep, mutable pos=0u, len=len, tystore=tystore);
auto result = parse_ty(st, sd);
@@ -75,7 +75,7 @@ fn parse_ty_str(str rep, str_def sd, @ty.type_store tystore) -> @ty.t {
ret result;
}
-fn parse_ty(@pstate st, str_def sd) -> @ty.t {
+fn parse_ty(@pstate st, str_def sd) -> ty.t {
alt (next(st) as char) {
case ('n') { ret ty.mk_nil(st.tystore); }
case ('b') { ret ty.mk_bool(st.tystore); }
@@ -101,7 +101,7 @@ fn parse_ty(@pstate st, str_def sd) -> @ty.t {
case ('t') {
check(next(st) as char == '[');
auto def = parse_def(st, sd);
- let vec[@ty.t] params = vec();
+ let vec[ty.t] params = vec();
while (peek(st) as char != ']') {
params += vec(parse_ty(st, sd));
}
@@ -213,7 +213,7 @@ fn parse_int(@pstate st) -> int {
ret n;
}
-fn parse_ty_fn(@pstate st, str_def sd) -> tup(vec[ty.arg], @ty.t) {
+fn parse_ty_fn(@pstate st, str_def sd) -> tup(vec[ty.arg], ty.t) {
check(next(st) as char == '[');
let vec[ty.arg] inputs = vec();
while (peek(st) as char != ']') {
@@ -331,7 +331,7 @@ fn variant_tag_id(&ebml.doc d) -> ast.def_id {
ret parse_def_id(ebml.doc_data(tagdoc));
}
-fn item_type(&ebml.doc item, int this_cnum, @ty.type_store tystore) -> @ty.t {
+fn item_type(&ebml.doc item, int this_cnum, @ty.type_store tystore) -> ty.t {
fn parse_external_def_id(int this_cnum, str s) -> ast.def_id {
// FIXME: This is completely wrong when linking against a crate
// that, in turn, links against another crate. We need a mapping
@@ -545,7 +545,7 @@ fn get_tag_variants(session.session sess,
for (ast.def_id did in variant_ids) {
auto item = find_item(did._1, items);
auto ctor_ty = item_type(item, external_crate_id, tystore);
- let vec[@ty.t] arg_tys = vec();
+ let vec[ty.t] arg_tys = vec();
alt (ty.struct(ctor_ty)) {
case (ty.ty_fn(_, ?args, _)) {
for (ty.arg a in args) {
diff --git a/src/comp/middle/metadata.rs b/src/comp/middle/metadata.rs
index 0325e32e..5cefa83c 100644
--- a/src/comp/middle/metadata.rs
+++ b/src/comp/middle/metadata.rs
@@ -52,7 +52,7 @@ const uint tag_index_table = 0x15u;
// Callback to translate defs to strs or back.
type def_str = fn(ast.def_id) -> str;
-fn ty_str(@ty.t t, def_str ds) -> str {
+fn ty_str(ty.t t, def_str ds) -> str {
ret sty_str(ty.struct(t), ds);
}
@@ -91,7 +91,7 @@ fn sty_str(ty.sty st, def_str ds) -> str {
case (ty.ty_str) {ret "s";}
case (ty.ty_tag(?def,?tys)) { // TODO restore def_id
auto acc = "t[" + ds(def) + "|";
- for (@ty.t t in tys) {acc += ty_str(t, ds);}
+ for (ty.t t in tys) {acc += ty_str(t, ds);}
ret acc + "]";
}
case (ty.ty_box(?mt)) {ret "@" + mt_str(mt, ds);}
@@ -151,7 +151,7 @@ fn proto_str(ast.proto proto) -> str {
}
}
-fn ty_fn_str(vec[ty.arg] args, @ty.t out, def_str ds) -> str {
+fn ty_fn_str(vec[ty.arg] args, ty.t out, def_str ds) -> str {
auto acc = "[";
for (ty.arg arg in args) {
if (arg.mode == ast.alias) {acc += "&";}
@@ -327,7 +327,7 @@ fn encode_variant_id(&ebml.writer ebml_w, ast.def_id vid) {
ebml.end_tag(ebml_w);
}
-fn encode_type(&ebml.writer ebml_w, @ty.t typ) {
+fn encode_type(&ebml.writer ebml_w, ty.t typ) {
ebml.start_tag(ebml_w, tag_items_data_item_type);
auto f = def_to_str;
ebml_w.writer.write(_str.bytes(ty_str(typ, f)));
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 7f723994..f995ee6e 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -101,15 +101,15 @@ state type crate_ctxt = rec(session.session sess,
ty.type_cache type_cache,
hashmap[ast.def_id, str] item_symbols,
// TODO: hashmap[tup(tag_id,subtys), @tag_info]
- hashmap[@ty.t, uint] tag_sizes,
+ hashmap[ty.t, uint] tag_sizes,
hashmap[ast.def_id, ValueRef] discrims,
hashmap[ast.def_id, str] discrim_symbols,
hashmap[ast.def_id, ValueRef] fn_pairs,
hashmap[ast.def_id, ValueRef] consts,
hashmap[ast.def_id,()] obj_methods,
- hashmap[@ty.t, @tydesc_info] tydescs,
+ hashmap[ty.t, @tydesc_info] tydescs,
hashmap[str, ValueRef] module_data,
- hashmap[@ty.t, TypeRef] lltypes,
+ hashmap[ty.t, TypeRef] lltypes,
@glue_fns glues,
namegen names,
std.sha1.sha1 sha,
@@ -122,7 +122,7 @@ type local_ctxt = rec(vec[str] path,
@crate_ctxt ccx);
-type self_vt = rec(ValueRef v, @ty.t t);
+type self_vt = rec(ValueRef v, ty.t t);
state type fn_ctxt = rec(ValueRef llfn,
ValueRef lltaskptr,
@@ -181,7 +181,7 @@ fn path_name(vec[str] path) -> str {
}
-fn mangle_name_by_type(@crate_ctxt ccx, vec[str] path, @ty.t t) -> str {
+fn mangle_name_by_type(@crate_ctxt ccx, vec[str] path, ty.t t) -> str {
ccx.sha.reset();
auto f = metadata.def_to_str;
ccx.sha.input_str(metadata.ty_str(t, f));
@@ -554,7 +554,7 @@ fn T_opaque_obj_ptr(type_names tn) -> TypeRef {
// return value was always meaningless in that case anyhow). Beware!
//
// TODO: Enforce via a predicate.
-fn type_of(@crate_ctxt cx, @ty.t t) -> TypeRef {
+fn type_of(@crate_ctxt cx, ty.t t) -> TypeRef {
if (ty.type_has_dynamic_size(t)) {
log_err "type_of() called on a type with dynamic size: " +
ty.ty_to_str(t);
@@ -597,7 +597,7 @@ fn type_of_fn_full(@crate_ctxt cx,
ast.proto proto,
option.t[TypeRef] obj_self,
vec[ty.arg] inputs,
- @ty.t output,
+ ty.t output,
uint ty_param_count) -> TypeRef {
let vec[TypeRef] atys = vec();
@@ -651,7 +651,7 @@ fn type_of_fn_full(@crate_ctxt cx,
fn type_of_fn(@crate_ctxt cx,
ast.proto proto,
vec[ty.arg] inputs,
- @ty.t output,
+ ty.t output,
uint ty_param_count) -> TypeRef {
ret type_of_fn_full(cx, proto, none[TypeRef], inputs, output,
ty_param_count);
@@ -659,7 +659,7 @@ fn type_of_fn(@crate_ctxt cx,
fn type_of_native_fn(@crate_ctxt cx, ast.native_abi abi,
vec[ty.arg] inputs,
- @ty.t output,
+ ty.t output,
uint ty_param_count) -> TypeRef {
let vec[TypeRef] atys = vec();
if (abi == ast.native_abi_rust) {
@@ -675,7 +675,7 @@ fn type_of_native_fn(@crate_ctxt cx, ast.native_abi abi,
ret T_fn(atys, type_of_inner(cx, output));
}
-fn type_of_inner(@crate_ctxt cx, @ty.t t) -> TypeRef {
+fn type_of_inner(@crate_ctxt cx, ty.t t) -> TypeRef {
// Check the cache.
if (cx.lltypes.contains_key(t)) {
ret cx.lltypes.get(t);
@@ -1119,14 +1119,14 @@ fn llalign_of(TypeRef t) -> ValueRef {
ret llvm.LLVMConstIntCast(lib.llvm.llvm.LLVMAlignOf(t), T_int(), False);
}
-fn size_of(@block_ctxt cx, @ty.t t) -> result {
+fn size_of(@block_ctxt cx, ty.t t) -> result {
if (!ty.type_has_dynamic_size(t)) {
ret res(cx, llsize_of(type_of(cx.fcx.lcx.ccx, t)));
}
ret dynamic_size_of(cx, t);
}
-fn align_of(@block_ctxt cx, @ty.t t) -> result {
+fn align_of(@block_ctxt cx, ty.t t) -> result {
if (!ty.type_has_dynamic_size(t)) {
ret res(cx, llalign_of(type_of(cx.fcx.lcx.ccx, t)));
}
@@ -1146,8 +1146,8 @@ fn array_alloca(@block_ctxt cx, TypeRef t, ValueRef n) -> ValueRef {
// to have (a) the same size as the type that was passed in; (b) to be non-
// recursive. This is done by replacing all boxes in a type with boxed unit
// types.
-fn simplify_type(@crate_ctxt ccx, @ty.t typ) -> @ty.t {
- fn simplifier(@crate_ctxt ccx, @ty.t typ) -> @ty.t {
+fn simplify_type(@crate_ctxt ccx, ty.t typ) -> ty.t {
+ fn simplifier(@crate_ctxt ccx, ty.t typ) -> ty.t {
alt (ty.struct(typ)) {
case (ty.ty_box(_)) {
ret ty.mk_imm_box(ccx.tystore, ty.mk_nil(ccx.tystore));
@@ -1160,7 +1160,7 @@ fn simplify_type(@crate_ctxt ccx, @ty.t typ) -> @ty.t {
}
// Computes the size of the data part of a non-dynamically-sized tag.
-fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
+fn static_size_of_tag(@crate_ctxt cx, ty.t t) -> uint {
if (ty.type_has_dynamic_size(t)) {
log_err "dynamically sized type passed to static_size_of_tag()";
fail;
@@ -1171,7 +1171,7 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
}
auto tid;
- let vec[@ty.t] subtys;
+ let vec[ty.t] subtys;
alt (ty.struct(t)) {
case (ty.ty_tag(?tid_, ?subtys_)) {
tid = tid_;
@@ -1206,8 +1206,8 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
ret max_size;
}
-fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
- fn align_elements(@block_ctxt cx, vec[@ty.t] elts) -> result {
+fn dynamic_size_of(@block_ctxt cx, ty.t t) -> result {
+ fn align_elements(@block_ctxt cx, vec[ty.t] elts) -> result {
//
// C padding rules:
//
@@ -1219,7 +1219,7 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
auto off = C_int(0);
auto max_align = C_int(1);
auto bcx = cx;
- for (@ty.t e in elts) {
+ for (ty.t e in elts) {
auto elt_align = align_of(bcx, e);
bcx = elt_align.bcx;
auto elt_size = size_of(bcx, e);
@@ -1238,14 +1238,14 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
ret res(szptr.bcx, szptr.bcx.build.Load(szptr.val));
}
case (ty.ty_tup(?elts)) {
- let vec[@ty.t] tys = vec();
+ let vec[ty.t] tys = vec();
for (ty.mt mt in elts) {
tys += vec(mt.ty);
}
ret align_elements(cx, tys);
}
case (ty.ty_rec(?flds)) {
- let vec[@ty.t] tys = vec();
+ let vec[ty.t] tys = vec();
for (ty.field f in flds) {
tys += vec(f.mt.ty);
}
@@ -1261,9 +1261,9 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
auto variants = tag_variants(bcx.fcx.lcx.ccx, tid);
for (variant_info variant in variants) {
// Perform type substitution on the raw argument types.
- let vec[@ty.t] raw_tys = variant.args;
- let vec[@ty.t] tys = vec();
- for (@ty.t raw_ty in raw_tys) {
+ let vec[ty.t] raw_tys = variant.args;
+ let vec[ty.t] tys = vec();
+ for (ty.t raw_ty in raw_tys) {
auto t = ty.bind_params_in_type(cx.fcx.lcx.ccx.tystore,
raw_ty);
t = ty.substitute_type_params(cx.fcx.lcx.ccx.tystore, tps,
@@ -1286,7 +1286,7 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
}
}
-fn dynamic_align_of(@block_ctxt cx, @ty.t t) -> result {
+fn dynamic_align_of(@block_ctxt cx, ty.t t) -> result {
alt (ty.struct(t)) {
case (ty.ty_param(?p)) {
auto aptr = field_of_tydesc(cx, t, abi.tydesc_field_align);
@@ -1324,7 +1324,7 @@ fn dynamic_align_of(@block_ctxt cx, @ty.t t) -> result {
// middle of the thing it's GEP'ing into. Much like size_of and align_of,
// above.
-fn GEP_tup_like(@block_ctxt cx, @ty.t t,
+fn GEP_tup_like(@block_ctxt cx, ty.t t,
ValueRef base, vec[int] ixs) -> result {
check (ty.type_is_tup_like(t));
@@ -1356,8 +1356,8 @@ fn GEP_tup_like(@block_ctxt cx, @ty.t t,
// elements of the type and splitting the Xth off. Return the prefix as
// well as the innermost Xth type.
- fn split_type(@ty.t t, vec[int] ixs, uint n)
- -> rec(vec[@ty.t] prefix, @ty.t target) {
+ fn split_type(ty.t t, vec[int] ixs, uint n)
+ -> rec(vec[ty.t] prefix, ty.t target) {
let uint len = _vec.len[int](ixs);
@@ -1378,10 +1378,10 @@ fn GEP_tup_like(@block_ctxt cx, @ty.t t,
check (n < len);
let int ix = ixs.(n);
- let vec[@ty.t] prefix = vec();
+ let vec[ty.t] prefix = vec();
let int i = 0;
while (i < ix) {
- _vec.push[@ty.t](prefix, ty.get_element_type(t, i as uint));
+ _vec.push[ty.t](prefix, ty.get_element_type(t, i as uint));
i += 1 ;
}
@@ -1429,7 +1429,7 @@ fn GEP_tag(@block_ctxt cx,
ValueRef llblobptr,
&ast.def_id tag_id,
&ast.def_id variant_id,
- vec[@ty.t] ty_substs,
+ vec[ty.t] ty_substs,
int ix)
-> result {
auto variant = tag_variant_with_id(cx.fcx.lcx.ccx, tag_id, variant_id);
@@ -1439,8 +1439,8 @@ fn GEP_tag(@block_ctxt cx,
auto arg_tys = variant.args;
auto elem_ty = ty.mk_nil(cx.fcx.lcx.ccx.tystore); // typestate infelicity
auto i = 0;
- let vec[@ty.t] true_arg_tys = vec();
- for (@ty.t aty in arg_tys) {
+ let vec[ty.t] true_arg_tys = vec();
+ for (ty.t aty in arg_tys) {
auto arg_ty = ty.bind_params_in_type(cx.fcx.lcx.ccx.tystore, aty);
arg_ty = ty.substitute_type_params(cx.fcx.lcx.ccx.tystore, ty_substs,
arg_ty);
@@ -1489,7 +1489,7 @@ fn trans_raw_malloc(@block_ctxt cx, TypeRef llptr_ty, ValueRef llsize)
ret rslt;
}
-fn trans_malloc_boxed(@block_ctxt cx, @ty.t t) -> result {
+fn trans_malloc_boxed(@block_ctxt cx, ty.t t) -> result {
// Synthesize a fake box type structurally so we have something
// to measure the size of.
auto boxed_body = ty.mk_imm_tup(cx.fcx.lcx.ccx.tystore,
@@ -1507,7 +1507,7 @@ fn trans_malloc_boxed(@block_ctxt cx, @ty.t t) -> result {
// Given a type and a field index into its corresponding type descriptor,
// returns an LLVM ValueRef of that field from the tydesc, generating the
// tydesc if necessary.
-fn field_of_tydesc(@block_ctxt cx, @ty.t t, int field) -> result {
+fn field_of_tydesc(@block_ctxt cx, ty.t t, int field) -> result {
auto tydesc = get_tydesc(cx, t);
ret res(tydesc.bcx,
tydesc.bcx.build.GEP(tydesc.val, vec(C_int(0), C_int(field))));
@@ -1517,7 +1517,7 @@ fn field_of_tydesc(@block_ctxt cx, @ty.t t, int field) -> result {
// each of the ty params it uses (from the current frame) and a vector of the
// indices of the ty params present in the type. This is used solely for
// constructing derived tydescs.
-fn linearize_ty_params(@block_ctxt cx, @ty.t t) ->
+fn linearize_ty_params(@block_ctxt cx, ty.t t) ->
tup(vec[uint], vec[ValueRef]) {
let vec[ValueRef] param_vals = vec();
let vec[uint] param_defs = vec();
@@ -1525,7 +1525,7 @@ fn linearize_ty_params(@block_ctxt cx, @ty.t t) ->
mutable vec[ValueRef] vals,
mutable vec[uint] defs);
- fn linearizer(@rr r, @ty.t t) {
+ fn linearizer(@rr r, ty.t t) {
alt(ty.struct(t)) {
case (ty.ty_param(?pid)) {
let bool seen = false;
@@ -1554,7 +1554,7 @@ fn linearize_ty_params(@block_ctxt cx, @ty.t t) ->
ret tup(x.defs, x.vals);
}
-fn get_tydesc(&@block_ctxt cx, @ty.t t) -> result {
+fn get_tydesc(&@block_ctxt cx, ty.t t) -> result {
// Is the supplied type a type param? If so, return the passed-in tydesc.
alt (ty.type_param(t)) {
case (some[uint](?id)) { ret res(cx, cx.fcx.lltydescs.(id)); }
@@ -1619,7 +1619,7 @@ fn get_tydesc(&@block_ctxt cx, @ty.t t) -> result {
// Generates the declaration for (but doesn't fill in) a type descriptor. This
// needs to be separate from make_tydesc() below, because sometimes type glue
// functions needs to refer to their own type descriptors.
-fn declare_tydesc(@local_ctxt cx, @ty.t t) {
+fn declare_tydesc(@local_ctxt cx, ty.t t) {
auto take_glue = declare_generic_glue(cx, t, T_glue_fn(cx.ccx.tn),
"take");
auto drop_glue = declare_generic_glue(cx, t, T_glue_fn(cx.ccx.tn),
@@ -1674,12 +1674,12 @@ fn declare_tydesc(@local_ctxt cx, @ty.t t) {
}
tag make_generic_glue_helper_fn {
- mgghf_single(fn(@block_ctxt cx, ValueRef v, @ty.t t));
+ mgghf_single(fn(@block_ctxt cx, ValueRef v, ty.t t));
mgghf_cmp;
}
// declare_tydesc() above must have been called first.
-fn define_tydesc(@local_ctxt cx, @ty.t t, vec[uint] ty_params) {
+fn define_tydesc(@local_ctxt cx, ty.t t, vec[uint] ty_params) {
auto info = cx.ccx.tydescs.get(t);
auto gvar = info.tydesc;
@@ -1691,7 +1691,7 @@ fn define_tydesc(@local_ctxt cx, @ty.t t, vec[uint] ty_params) {
}
fn declare_generic_glue(@local_ctxt cx,
- @ty.t t,
+ ty.t t,
TypeRef llfnty,
str name) -> ValueRef {
auto gcx = @rec(path=vec("glue", name) with *cx);
@@ -1702,7 +1702,7 @@ fn declare_generic_glue(@local_ctxt cx,
}
fn make_generic_glue(@local_ctxt cx,
- @ty.t t,
+ ty.t t,
ValueRef llfn,
make_generic_glue_helper_fn helper,
vec[uint] ty_params) -> ValueRef {
@@ -1760,7 +1760,7 @@ fn make_generic_glue(@local_ctxt cx,
ret llfn;
}
-fn make_take_glue(@block_ctxt cx, ValueRef v, @ty.t t) {
+fn make_take_glue(@block_ctxt cx, ValueRef v, ty.t t) {
// NB: v is an *alias* of type t here, not a direct value.
auto bcx;
if (ty.type_is_boxed(t)) {
@@ -1794,7 +1794,7 @@ fn incr_refcnt_of_boxed(@block_ctxt cx, ValueRef box_ptr) -> result {
ret res(next_cx, C_nil());
}
-fn make_drop_glue(@block_ctxt cx, ValueRef v0, @ty.t t) {
+fn make_drop_glue(@block_ctxt cx, ValueRef v0, ty.t t) {
// NB: v0 is an *alias* of type t here, not a direct value.
auto rslt;
alt (ty.struct(t)) {
@@ -1808,7 +1808,7 @@ fn make_drop_glue(@block_ctxt cx, ValueRef v0, @ty.t t) {
case (ty.ty_vec(_)) {
fn hit_zero(@block_ctxt cx, ValueRef v,
- @ty.t t) -> result {
+ ty.t t) -> result {
auto res = iter_sequence(cx, v, t,
bind drop_ty(_,_,_));
// FIXME: switch gc/non-gc on layer of the type.
@@ -1823,7 +1823,7 @@ fn make_drop_glue(@block_ctxt cx, ValueRef v0, @ty.t t) {
case (ty.ty_box(?body_mt)) {
fn hit_zero(@block_ctxt cx, ValueRef v,
- @ty.t body_ty) -> result {
+ ty.t body_ty) -> result {
auto body = cx.build.GEP(v,
vec(C_int(0),
C_int(abi.box_rc_field_body)));
@@ -2001,7 +2001,7 @@ fn decr_refcnt_and_if_zero(@block_ctxt cx,
fn make_cmp_glue(@block_ctxt cx,
ValueRef lhs0,
ValueRef rhs0,
- @ty.t t,
+ ty.t t,
ValueRef llop) {
auto lhs = load_if_immediate(cx, lhs0, t);
auto rhs = load_if_immediate(cx, rhs0, t);
@@ -2079,7 +2079,7 @@ fn make_cmp_glue(@block_ctxt cx,
@block_ctxt cx,
ValueRef av0,
ValueRef bv0,
- @ty.t t) -> result {
+ ty.t t) -> result {
auto cnt_cx = new_sub_block_ctxt(cx, "continue_comparison");
auto stop_cx = new_sub_block_ctxt(cx, "stop_comparison");
@@ -2145,7 +2145,7 @@ fn make_cmp_glue(@block_ctxt cx,
}
// A helper function to create scalar comparison glue.
-fn make_scalar_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs, @ty.t t,
+fn make_scalar_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs, ty.t t,
ValueRef llop) {
if (ty.type_is_fp(t)) {
make_fp_cmp_glue(cx, lhs, rhs, t, llop);
@@ -2168,7 +2168,7 @@ fn make_scalar_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs, @ty.t t,
}
// A helper function to create floating point comparison glue.
-fn make_fp_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs, @ty.t fptype,
+fn make_fp_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs, ty.t fptype,
ValueRef llop) {
auto last_cx = new_sub_block_ctxt(cx, "last");
@@ -2242,7 +2242,7 @@ fn compare_integral_values(@block_ctxt cx, ValueRef lhs, ValueRef rhs,
// A helper function to create integral comparison glue.
fn make_integral_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs,
- @ty.t intype, ValueRef llop) {
+ ty.t intype, ValueRef llop) {
auto r = compare_integral_values(cx, lhs, rhs, ty.type_is_signed(intype),
llop);
r.bcx.build.Store(r.val, r.bcx.fcx.llretptr);
@@ -2252,7 +2252,7 @@ fn make_integral_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs,
// Tag information
-type variant_info = rec(vec[@ty.t] args, @ty.t ctor_ty, ast.def_id id);
+type variant_info = rec(vec[ty.t] args, ty.t ctor_ty, ast.def_id id);
// Returns information about the variants in a tag.
fn tag_variants(@crate_ctxt cx, ast.def_id id) -> vec[variant_info] {
@@ -2266,7 +2266,7 @@ fn tag_variants(@crate_ctxt cx, ast.def_id id) -> vec[variant_info] {
let vec[variant_info] result = vec();
for (ast.variant variant in variants) {
auto ctor_ty = node_ann_type(cx, variant.node.ann);
- let vec[@ty.t] arg_tys = vec();
+ let vec[ty.t] arg_tys = vec();
if (_vec.len[ast.variant_arg](variant.node.args) > 0u) {
for (ty.arg a in ty.ty_fn_args(ctor_ty)) {
arg_tys += vec(a.ty);
@@ -2303,22 +2303,22 @@ fn tag_variant_with_id(@crate_ctxt cx,
type val_pair_fn = fn(@block_ctxt cx, ValueRef dst, ValueRef src) -> result;
-type val_and_ty_fn = fn(@block_ctxt cx, ValueRef v, @ty.t t) -> result;
+type val_and_ty_fn = fn(@block_ctxt cx, ValueRef v, ty.t t) -> result;
type val_pair_and_ty_fn =
- fn(@block_ctxt cx, ValueRef av, ValueRef bv, @ty.t t) -> result;
+ fn(@block_ctxt cx, ValueRef av, ValueRef bv, ty.t t) -> result;
// Iterates through the elements of a structural type.
fn iter_structural_ty(@block_ctxt cx,
ValueRef v,
- @ty.t t,
+ ty.t t,
val_and_ty_fn f)
-> result {
fn adaptor_fn(val_and_ty_fn f,
@block_ctxt cx,
ValueRef av,
ValueRef bv,
- @ty.t t) -> result {
+ ty.t t) -> result {
ret f(cx, av, t);
}
be iter_structural_ty_full(cx, v, v, t,
@@ -2329,7 +2329,7 @@ fn iter_structural_ty(@block_ctxt cx,
fn iter_structural_ty_full(@block_ctxt cx,
ValueRef av,
ValueRef bv,
- @ty.t t,
+ ty.t t,
val_pair_and_ty_fn f)
-> result {
let result r = res(cx, C_nil());
@@ -2424,7 +2424,7 @@ fn iter_structural_ty_full(@block_ctxt cx,
_uint.to_str(i, 10u));
llvm.LLVMAddCase(llswitch, C_int(i as int), variant_cx.llbb);
- if (_vec.len[@ty.t](variant.args) > 0u) {
+ if (_vec.len[ty.t](variant.args) > 0u) {
// N-ary variant.
auto fn_ty = variant.ctor_ty;
alt (ty.struct(fn_ty)) {
@@ -2559,10 +2559,10 @@ fn iter_sequence_raw(@block_ctxt cx,
fn iter_sequence_inner(@block_ctxt cx,
ValueRef src, // elt*
ValueRef src_lim, // elt*
- @ty.t elt_ty,
+ ty.t elt_ty,
val_and_ty_fn f) -> result {
fn adaptor_fn(val_and_ty_fn f,
- @ty.t elt_ty,
+ ty.t elt_ty,
@block_ctxt cx,
ValueRef dst,
ValueRef src) -> result {
@@ -2587,12 +2587,12 @@ fn iter_sequence_inner(@block_ctxt cx,
// Iterates through the elements of a vec or str.
fn iter_sequence(@block_ctxt cx,
ValueRef v,
- @ty.t t,
+ ty.t t,
val_and_ty_fn f) -> result {
fn iter_sequence_body(@block_ctxt cx,
ValueRef v,
- @ty.t elt_ty,
+ ty.t elt_ty,
val_and_ty_fn f,
bool trailing_null) -> result {
@@ -2654,14 +2654,14 @@ fn call_tydesc_glue_full(@block_ctxt cx, ValueRef v,
llrawptr));
}
-fn call_tydesc_glue(@block_ctxt cx, ValueRef v, @ty.t t, int field) {
+fn call_tydesc_glue(@block_ctxt cx, ValueRef v, ty.t t, int field) {
auto td = get_tydesc(cx, t);
call_tydesc_glue_full(td.bcx,
spill_if_immediate(td.bcx, v, t),
td.val, field);
}
-fn call_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs, @ty.t t,
+fn call_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs, ty.t t,
ValueRef llop) -> result {
// We can't use call_tydesc_glue_full() and friends here because compare
// glue has a special signature.
@@ -2697,7 +2697,7 @@ fn call_cmp_glue(@block_ctxt cx, ValueRef lhs, ValueRef rhs, @ty.t t,
ret res(r.bcx, r.bcx.build.Load(llcmpresultptr));
}
-fn take_ty(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
+fn take_ty(@block_ctxt cx, ValueRef v, ty.t t) -> result {
if (!ty.type_is_scalar(t)) {
call_tydesc_glue(cx, v, t, abi.tydesc_field_take_glue);
}
@@ -2706,7 +2706,7 @@ fn take_ty(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
fn drop_slot(@block_ctxt cx,
ValueRef slot,
- @ty.t t) -> result {
+ ty.t t) -> result {
auto llptr = load_if_immediate(cx, slot, t);
auto re = drop_ty(cx, llptr, t);
@@ -2718,7 +2718,7 @@ fn drop_slot(@block_ctxt cx,
fn drop_ty(@block_ctxt cx,
ValueRef v,
- @ty.t t) -> result {
+ ty.t t) -> result {
if (!ty.type_is_scalar(t)) {
call_tydesc_glue(cx, v, t, abi.tydesc_field_drop_glue);
@@ -2749,7 +2749,7 @@ fn call_bzero(@block_ctxt cx,
fn memcpy_ty(@block_ctxt cx,
ValueRef dst,
ValueRef src,
- @ty.t t) -> result {
+ ty.t t) -> result {
if (ty.type_has_dynamic_size(t)) {
auto llszptr = field_of_tydesc(cx, t, abi.tydesc_field_size);
auto llsz = llszptr.bcx.build.Load(llszptr.val);
@@ -2769,7 +2769,7 @@ fn copy_ty(@block_ctxt cx,
copy_action action,
ValueRef dst,
ValueRef src,
- @ty.t t) -> result {
+ ty.t t) -> result {
if (ty.type_is_scalar(t) || ty.type_is_native(t)) {
ret res(cx, cx.build.Store(src, dst));
@@ -2849,7 +2849,7 @@ fn trans_lit(@crate_ctxt cx, &ast.lit lit, &ast.ann ann) -> ValueRef {
}
}
-fn target_type(@crate_ctxt cx, @ty.t t) -> @ty.t {
+fn target_type(@crate_ctxt cx, ty.t t) -> ty.t {
alt (ty.struct(t)) {
case (ty.ty_int) {
auto struct_ty = ty.mk_mach(cx.tystore,
@@ -2868,11 +2868,11 @@ fn target_type(@crate_ctxt cx, @ty.t t) -> @ty.t {
// Converts an annotation to a type
-fn node_ann_type(@crate_ctxt cx, &ast.ann a) -> @ty.t {
+fn node_ann_type(@crate_ctxt cx, &ast.ann a) -> ty.t {
ret target_type(cx, ty.ann_to_monotype(cx.tystore, a));
}
-fn node_ann_ty_params(&ast.ann a) -> vec[@ty.t] {
+fn node_ann_ty_params(&ast.ann a) -> vec[ty.t] {
alt (a) {
case (ast.ann_none) {
log_err "missing type annotation";
@@ -2880,11 +2880,11 @@ fn node_ann_ty_params(&ast.ann a) -> vec[@ty.t] {
}
case (ast.ann_type(_, ?tps_opt, _)) {
alt (tps_opt) {
- case (none[vec[@ty.t]]) {
+ case (none[vec[ty.t]]) {
log_err "type annotation has no ty params";
fail;
}
- case (some[vec[@ty.t]](?tps)) { ret tps; }
+ case (some[vec[ty.t]](?tps)) { ret tps; }
}
}
}
@@ -2958,7 +2958,7 @@ fn trans_unary(@block_ctxt cx, ast.unop op,
fail;
}
-fn trans_compare(@block_ctxt cx0, ast.binop op, @ty.t t0,
+fn trans_compare(@block_ctxt cx0, ast.binop op, ty.t t0,
ValueRef lhs0, ValueRef rhs0) -> result {
// Autoderef both sides.
auto cx = cx0;
@@ -2999,7 +2999,7 @@ fn trans_compare(@block_ctxt cx0, ast.binop op, @ty.t t0,
}
}
-fn trans_vec_append(@block_ctxt cx, @ty.t t,
+fn trans_vec_append(@block_ctxt cx, ty.t t,
ValueRef lhs, ValueRef rhs) -> result {
auto elt_ty = ty.sequence_element_type(cx.fcx.lcx.ccx.tystore, t);
@@ -3028,7 +3028,7 @@ fn trans_vec_append(@block_ctxt cx, @ty.t t,
dst, src, skip_null)));
}
-fn trans_vec_add(@block_ctxt cx, @ty.t t,
+fn trans_vec_add(@block_ctxt cx, ty.t t,
ValueRef lhs, ValueRef rhs) -> result {
auto r = alloc_ty(cx, t);
auto tmp = r.val;
@@ -3041,7 +3041,7 @@ fn trans_vec_add(@block_ctxt cx, @ty.t t,
}
-fn trans_eager_binop(@block_ctxt cx, ast.binop op, @ty.t intype,
+fn trans_eager_binop(@block_ctxt cx, ast.binop op, ty.t intype,
ValueRef lhs, ValueRef rhs) -> result {
auto is_float = false;
@@ -3118,9 +3118,9 @@ fn trans_eager_binop(@block_ctxt cx, ast.binop op, @ty.t intype,
fail;
}
-fn autoderef(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
+fn autoderef(@block_ctxt cx, ValueRef v, ty.t t) -> result {
let ValueRef v1 = v;
- let @ty.t t1 = t;
+ let ty.t t1 = t;
while (true) {
alt (ty.struct(t1)) {
@@ -3150,8 +3150,8 @@ fn autoderef(@block_ctxt cx, ValueRef v, @ty.t t) -> result {
}
}
-fn autoderefed_ty(@ty.t t) -> @ty.t {
- let @ty.t t1 = t;
+fn autoderefed_ty(ty.t t) -> ty.t {
+ let ty.t t1 = t;
while (true) {
alt (ty.struct(t1)) {
@@ -3329,7 +3329,7 @@ fn trans_for(@block_ctxt cx,
&ast.block body) -> result {
fn inner(@block_ctxt cx,
@ast.local local, ValueRef curr,
- @ty.t t, ast.block body,
+ ty.t t, ast.block body,
@block_ctxt outer_next_cx) -> result {
auto next_cx = new_sub_block_ctxt(cx, "next");
@@ -3841,21 +3841,21 @@ fn trans_alt(@block_ctxt cx, @ast.expr expr,
ret join_results(cx, expr_llty, arm_results);
}
-type generic_info = rec(@ty.t item_type,
+type generic_info = rec(ty.t item_type,
vec[ValueRef] tydescs);
type lval_result = rec(result res,
bool is_mem,
option.t[generic_info] generic,
option.t[ValueRef] llobj,
- option.t[@ty.t] method_ty);
+ option.t[ty.t] method_ty);
fn lval_mem(@block_ctxt cx, ValueRef val) -> lval_result {
ret rec(res=res(cx, val),
is_mem=true,
generic=none[generic_info],
llobj=none[ValueRef],
- method_ty=none[@ty.t]);
+ method_ty=none[ty.t]);
}
fn lval_val(@block_ctxt cx, ValueRef val) -> lval_result {
@@ -3863,7 +3863,7 @@ fn lval_val(@block_ctxt cx, ValueRef val) -> lval_result {
is_mem=false,
generic=none[generic_info],
llobj=none[ValueRef],
- method_ty=none[@ty.t]);
+ method_ty=none[ty.t]);
}
fn trans_external_path(@block_ctxt cx, ast.def_id did,
@@ -3891,7 +3891,7 @@ fn lval_generic_fn(@block_ctxt cx,
}
auto monoty;
- let vec[@ty.t] tys;
+ let vec[ty.t] tys;
alt (ann) {
case (ast.ann_none) {
cx.fcx.lcx.ccx.sess.bug("no type annotation for path!");
@@ -3899,14 +3899,14 @@ fn lval_generic_fn(@block_ctxt cx,
}
case (ast.ann_type(?monoty_, ?tps, _)) {
monoty = monoty_;
- tys = option.get[vec[@ty.t]](tps);
+ tys = option.get[vec[ty.t]](tps);
}
}
- if (_vec.len[@ty.t](tys) != 0u) {
+ if (_vec.len[ty.t](tys) != 0u) {
auto bcx = cx;
let vec[ValueRef] tydescs = vec();
- for (@ty.t t in tys) {
+ for (ty.t t in tys) {
auto td = get_tydesc(bcx, t);
bcx = td.bcx;
_vec.push[ValueRef](tydescs, td.val);
@@ -4046,7 +4046,7 @@ fn trans_path(@block_ctxt cx, &ast.path p, &option.t[ast.def] dopt,
fail;
}
-fn trans_field(@block_ctxt cx, &ast.span sp, ValueRef v, @ty.t t0,
+fn trans_field(@block_ctxt cx, &ast.span sp, ValueRef v, ty.t t0,
&ast.ident field, &ast.ann ann) -> lval_result {
auto r = autoderef(cx, v, t0);
@@ -4075,10 +4075,10 @@ fn trans_field(@block_ctxt cx, &ast.span sp, ValueRef v, @ty.t t0,
C_int(ix as int)));
auto lvo = lval_mem(r.bcx, v);
- let @ty.t fn_ty = ty.method_ty_to_fn_ty(cx.fcx.lcx.ccx.tystore,
+ let ty.t fn_ty = ty.method_ty_to_fn_ty(cx.fcx.lcx.ccx.tystore,
methods.(ix));
ret rec(llobj = some[ValueRef](r.val),
- method_ty = some[@ty.t](fn_ty)
+ method_ty = some[ty.t](fn_ty)
with lvo);
}
case (_) {cx.fcx.lcx.ccx.sess.unimpl("field variant in trans_field");}
@@ -4230,11 +4230,11 @@ fn trans_cast(@block_ctxt cx, @ast.expr e, &ast.ann ann) -> result {
}
fn trans_bind_thunk(@local_ctxt cx,
- @ty.t incoming_fty,
- @ty.t outgoing_fty,
+ ty.t incoming_fty,
+ ty.t outgoing_fty,
vec[option.t[@ast.expr]] args,
- @ty.t closure_ty,
- vec[@ty.t] bound_tys,
+ ty.t closure_ty,
+ vec[ty.t] bound_tys,
uint ty_param_count) -> ValueRef {
// Construct a thunk-call with signature incoming_fty, and that copies
// args forward into a call to outgoing_fty.
@@ -4387,7 +4387,7 @@ fn trans_bind(@block_ctxt cx, @ast.expr f,
}
// Figure out which tydescs we need to pass, if any.
- let @ty.t outgoing_fty;
+ let ty.t outgoing_fty;
let vec[ValueRef] lltydescs;
alt (f_res.generic) {
case (none[generic_info]) {
@@ -4410,7 +4410,7 @@ fn trans_bind(@block_ctxt cx, @ast.expr f,
auto pair_v = alloca(bcx, pair_t);
// Translate the bound expressions.
- let vec[@ty.t] bound_tys = vec();
+ let vec[ty.t] bound_tys = vec();
let vec[ValueRef] bound_vals = vec();
auto i = 0u;
for (@ast.expr e in bound) {
@@ -4418,31 +4418,31 @@ fn trans_bind(@block_ctxt cx, @ast.expr f,
bcx = arg.bcx;
_vec.push[ValueRef](bound_vals, arg.val);
- _vec.push[@ty.t](bound_tys,
+ _vec.push[ty.t](bound_tys,
ty.expr_ty(cx.fcx.lcx.ccx.tystore, e));
i += 1u;
}
// Synthesize a closure type.
- let @ty.t bindings_ty = ty.mk_imm_tup(cx.fcx.lcx.ccx.tystore,
+ let ty.t bindings_ty = ty.mk_imm_tup(cx.fcx.lcx.ccx.tystore,
bound_tys);
// NB: keep this in sync with T_closure_ptr; we're making
// a ty.t structure that has the same "shape" as the LLVM type
// it constructs.
- let @ty.t tydesc_ty = ty.mk_type(cx.fcx.lcx.ccx.tystore);
+ let ty.t tydesc_ty = ty.mk_type(cx.fcx.lcx.ccx.tystore);
- let vec[@ty.t] captured_tys =
- _vec.init_elt[@ty.t](tydesc_ty, ty_param_count);
+ let vec[ty.t] captured_tys =
+ _vec.init_elt[ty.t](tydesc_ty, ty_param_count);
- let vec[@ty.t] closure_tys =
+ let vec[ty.t] closure_tys =
vec(tydesc_ty,
outgoing_fty,
bindings_ty,
ty.mk_imm_tup(cx.fcx.lcx.ccx.tystore, captured_tys));
- let @ty.t closure_ty = ty.mk_imm_tup(cx.fcx.lcx.ccx.tystore,
+ let ty.t closure_ty = ty.mk_imm_tup(cx.fcx.lcx.ccx.tystore,
closure_tys);
auto r = trans_malloc_boxed(bcx, closure_ty);
@@ -4528,7 +4528,7 @@ fn trans_bind(@block_ctxt cx, @ast.expr f,
vec(C_int(0),
C_int(abi.fn_field_code)));
- let @ty.t pair_ty = node_ann_type(cx.fcx.lcx.ccx, ann);
+ let ty.t pair_ty = node_ann_type(cx.fcx.lcx.ccx, ann);
let ValueRef llthunk =
trans_bind_thunk(cx.fcx.lcx, pair_ty, outgoing_fty,
@@ -4568,7 +4568,7 @@ fn trans_args(@block_ctxt cx,
option.t[generic_info] gen,
option.t[ValueRef] lliterbody,
&vec[@ast.expr] es,
- @ty.t fn_ty)
+ ty.t fn_ty)
-> tup(@block_ctxt, vec[ValueRef], ValueRef) {
let vec[ty.arg] args = ty.ty_fn_args(fn_ty);
@@ -4744,9 +4744,9 @@ fn trans_call(@block_ctxt cx, @ast.expr f,
}
}
- let @ty.t fn_ty;
+ let ty.t fn_ty;
alt (f_res.method_ty) {
- case (some[@ty.t](?meth)) {
+ case (some[ty.t](?meth)) {
// self-call
fn_ty = meth;
}
@@ -4849,7 +4849,7 @@ fn trans_vec(@block_ctxt cx, vec[@ast.expr] args,
auto pseudo_tup_ty =
ty.mk_imm_tup(cx.fcx.lcx.ccx.tystore,
- _vec.init_elt[@ty.t](unit_ty,
+ _vec.init_elt[ty.t](unit_ty,
_vec.len[@ast.expr](args)));
let int i = 0;
@@ -5117,7 +5117,7 @@ fn trans_expr(@block_ctxt cx, @ast.expr e) -> result {
// pointer (or need one), perform load/store operations based on the
// immediate-ness of the type.
-fn type_is_immediate(@ty.t t) -> bool {
+fn type_is_immediate(ty.t t) -> bool {
ret ty.type_is_scalar(t) || ty.type_is_boxed(t) || ty.type_is_native(t);
}
@@ -5128,14 +5128,14 @@ fn do_spill(@block_ctxt cx, ValueRef v) -> ValueRef {
ret llptr;
}
-fn spill_if_immediate(@block_ctxt cx, ValueRef v, @ty.t t) -> ValueRef {
+fn spill_if_immediate(@block_ctxt cx, ValueRef v, ty.t t) -> ValueRef {
if (type_is_immediate(t)) {
ret do_spill(cx, v);
}
ret v;
}
-fn load_if_immediate(@block_ctxt cx, ValueRef v, @ty.t t) -> ValueRef {
+fn load_if_immediate(@block_ctxt cx, ValueRef v, ty.t t) -> ValueRef {
if (type_is_immediate(t)) {
ret cx.build.Load(v);
}
@@ -5477,7 +5477,7 @@ fn trans_recv(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs,
}
fn recv_val(@block_ctxt cx, ValueRef lhs, @ast.expr rhs,
- @ty.t unit_ty, copy_action action) -> result {
+ ty.t unit_ty, copy_action action) -> result {
auto bcx = cx;
auto prt = trans_expr(bcx, rhs);
@@ -5527,7 +5527,7 @@ fn init_local(@block_ctxt cx, @ast.local local) -> result {
ret res(bcx, llptr);
}
-fn zero_alloca(@block_ctxt cx, ValueRef llptr, @ty.t t) -> result {
+fn zero_alloca(@block_ctxt cx, ValueRef llptr, ty.t t) -> result {
auto bcx = cx;
if (ty.type_has_dynamic_size(t)) {
auto llsz = size_of(bcx, t);
@@ -5660,7 +5660,7 @@ fn llallocas_block_ctxt(@fn_ctxt fcx) -> @block_ctxt {
fcx=fcx);
}
-fn alloc_ty(@block_ctxt cx, @ty.t t) -> result {
+fn alloc_ty(@block_ctxt cx, ty.t t) -> result {
auto val = C_int(0);
if (ty.type_has_dynamic_size(t)) {
@@ -5744,7 +5744,7 @@ fn trans_block(@block_ctxt cx, &ast.block b) -> result {
fn drop_hoisted_ty(@block_ctxt cx,
ValueRef alloca_val,
- @ty.t t) -> result {
+ ty.t t) -> result {
auto reg_val = load_if_immediate(cx,
alloca_val, t);
ret drop_ty(cx, reg_val, t);
@@ -5822,18 +5822,18 @@ fn new_fn_ctxt(@local_ctxt cx,
fn create_llargs_for_fn_args(&@fn_ctxt cx,
ast.proto proto,
- option.t[tup(TypeRef, @ty.t)] ty_self,
- @ty.t ret_ty,
+ option.t[tup(TypeRef, ty.t)] ty_self,
+ ty.t ret_ty,
&vec[ast.arg] args,
&vec[ast.ty_param] ty_params) {
auto arg_n = 3u;
alt (ty_self) {
- case (some[tup(TypeRef, @ty.t)](?tt)) {
+ case (some[tup(TypeRef, ty.t)](?tt)) {
cx.llself = some[self_vt](rec(v = cx.llenv, t = tt._1));
}
- case (none[tup(TypeRef, @ty.t)]) {
+ case (none[tup(TypeRef, ty.t)]) {
auto i = 0u;
for (ast.ty_param tp in ty_params) {
auto llarg = llvm.LLVMGetParam(cx.llfn, arg_n);
@@ -5865,14 +5865,14 @@ fn create_llargs_for_fn_args(&@fn_ctxt cx,
// were passed and whatnot. Apparently mem2reg will mop up.
fn copy_any_self_to_alloca(@fn_ctxt fcx,
- option.t[tup(TypeRef, @ty.t)] ty_self) {
+ option.t[tup(TypeRef, ty.t)] ty_self) {
auto bcx = llallocas_block_ctxt(fcx);
alt (fcx.llself) {
case (some[self_vt](?s_vt)) {
alt (ty_self) {
- case (some[tup(TypeRef, @ty.t)](?tt)) {
+ case (some[tup(TypeRef, ty.t)](?tt)) {
auto a = alloca(bcx, tt._0);
bcx.build.Store(s_vt.v, a);
fcx.llself = some[self_vt](rec(v = a, t = s_vt.t));
@@ -5923,7 +5923,7 @@ fn arg_tys_of_fn(ast.ann ann) -> vec[ty.arg] {
fail;
}
-fn ret_ty_of_fn_ty(@ty.t t) -> @ty.t {
+fn ret_ty_of_fn_ty(ty.t t) -> ty.t {
alt (ty.struct(t)) {
case (ty.ty_fn(_, _, ?ret_ty)) {
ret ret_ty;
@@ -5933,14 +5933,14 @@ fn ret_ty_of_fn_ty(@ty.t t) -> @ty.t {
}
-fn ret_ty_of_fn(ast.ann ann) -> @ty.t {
+fn ret_ty_of_fn(ast.ann ann) -> ty.t {
ret ret_ty_of_fn_ty(ty.ann_to_type(ann));
}
fn populate_fn_ctxt_from_llself(@fn_ctxt fcx, self_vt llself) {
auto bcx = llallocas_block_ctxt(fcx);
- let vec[@ty.t] field_tys = vec();
+ let vec[ty.t] field_tys = vec();
for (ast.obj_field f in bcx.fcx.lcx.obj_fields) {
field_tys += vec(node_ann_type(bcx.fcx.lcx.ccx, f.ann));
@@ -6007,7 +6007,7 @@ fn populate_fn_ctxt_from_llself(@fn_ctxt fcx, self_vt llself) {
}
fn trans_fn(@local_ctxt cx, &ast._fn f, ast.def_id fid,
- option.t[tup(TypeRef, @ty.t)] ty_self,
+ option.t[tup(TypeRef, ty.t)] ty_self,
&vec[ast.ty_param] ty_params, &ast.ann ann) {
auto llfndecl = cx.ccx.item_ids.get(fid);
@@ -6045,7 +6045,7 @@ fn trans_fn(@local_ctxt cx, &ast._fn f, ast.def_id fid,
fn trans_vtbl(@local_ctxt cx,
TypeRef llself_ty,
- @ty.t self_ty,
+ ty.t self_ty,
&ast._obj ob,
&vec[ast.ty_param] ty_params) -> ValueRef {
let vec[ValueRef] methods = vec();
@@ -6077,7 +6077,7 @@ fn trans_vtbl(@local_ctxt cx,
cx.ccx.item_symbols.insert(m.node.id, s);
trans_fn(mcx, m.node.meth, m.node.id,
- some[tup(TypeRef, @ty.t)](tup(llself_ty, self_ty)),
+ some[tup(TypeRef, ty.t)](tup(llself_ty, self_ty)),
ty_params, m.node.ann);
methods += vec(llfn);
}
@@ -6094,7 +6094,7 @@ fn trans_vtbl(@local_ctxt cx,
fn trans_dtor(@local_ctxt cx,
TypeRef llself_ty,
- @ty.t self_ty,
+ ty.t self_ty,
&vec[ast.ty_param] ty_params,
&@ast.method dtor) -> ValueRef {
@@ -6115,7 +6115,7 @@ fn trans_dtor(@local_ctxt cx,
cx.ccx.item_symbols.insert(dtor.node.id, s);
trans_fn(dcx, dtor.node.meth, dtor.node.id,
- some[tup(TypeRef, @ty.t)](tup(llself_ty, self_ty)),
+ some[tup(TypeRef, ty.t)](tup(llself_ty, self_ty)),
ty_params, dtor.node.ann);
ret llfn;
@@ -6137,7 +6137,7 @@ fn trans_obj(@local_ctxt cx, &ast._obj ob, ast.def_id oid,
auto fcx = new_fn_ctxt(cx, llctor_decl);
create_llargs_for_fn_args(fcx, ast.proto_fn,
- none[tup(TypeRef, @ty.t)],
+ none[tup(TypeRef, ty.t)],
ret_ty_of_fn(ann),
fn_args, ty_params);
@@ -6167,25 +6167,25 @@ fn trans_obj(@local_ctxt cx, &ast._obj ob, ast.def_id oid,
bcx.build.Store(C_null(llbox_ty), pair_box);
} else {
// Malloc a box for the body and copy args in.
- let vec[@ty.t] obj_fields = vec();
+ let vec[ty.t] obj_fields = vec();
for (ty.arg a in arg_tys) {
- _vec.push[@ty.t](obj_fields, a.ty);
+ _vec.push[ty.t](obj_fields, a.ty);
}
// Synthesize an obj body type.
auto tydesc_ty = ty.mk_type(cx.ccx.tystore);
- let vec[@ty.t] tps = vec();
+ let vec[ty.t] tps = vec();
for (ast.ty_param tp in ty_params) {
- _vec.push[@ty.t](tps, tydesc_ty);
+ _vec.push[ty.t](tps, tydesc_ty);
}
- let @ty.t typarams_ty = ty.mk_imm_tup(cx.ccx.tystore, tps);
- let @ty.t fields_ty = ty.mk_imm_tup(cx.ccx.tystore, obj_fields);
- let @ty.t body_ty = ty.mk_imm_tup(cx.ccx.tystore,
+ let ty.t typarams_ty = ty.mk_imm_tup(cx.ccx.tystore, tps);
+ let ty.t fields_ty = ty.mk_imm_tup(cx.ccx.tystore, obj_fields);
+ let ty.t body_ty = ty.mk_imm_tup(cx.ccx.tystore,
vec(tydesc_ty,
typarams_ty,
fields_ty));
- let @ty.t boxed_body_ty = ty.mk_imm_box(cx.ccx.tystore, body_ty);
+ let ty.t boxed_body_ty = ty.mk_imm_box(cx.ccx.tystore, body_ty);
// Malloc a box for the body.
auto box = trans_malloc_boxed(bcx, body_ty);
@@ -6280,11 +6280,11 @@ fn trans_tag_variant(@local_ctxt cx, ast.def_id tag_id,
auto fcx = new_fn_ctxt(cx, llfndecl);
create_llargs_for_fn_args(fcx, ast.proto_fn,
- none[tup(TypeRef, @ty.t)],
+ none[tup(TypeRef, ty.t)],
ret_ty_of_fn(variant.node.ann),
fn_args, ty_params);
- let vec[@ty.t] ty_param_substs = vec();
+ let vec[ty.t] ty_param_substs = vec();
i = 0u;
for (ast.ty_param tp in ty_params) {
ty_param_substs += vec(ty.mk_param(cx.ccx.tystore, i));
@@ -6371,7 +6371,7 @@ fn trans_item(@local_ctxt cx, &ast.item item) {
alt (item.node) {
case (ast.item_fn(?name, ?f, ?tps, ?fid, ?ann)) {
auto sub_cx = extend_path(cx, name);
- trans_fn(sub_cx, f, fid, none[tup(TypeRef, @ty.t)], tps, ann);
+ trans_fn(sub_cx, f, fid, none[tup(TypeRef, ty.t)], tps, ann);
}
case (ast.item_obj(?name, ?ob, ?tps, ?oid, ?ann)) {
auto sub_cx = @rec(obj_typarams=tps,
@@ -6480,7 +6480,7 @@ fn native_fn_ty_param_count(@crate_ctxt cx, &ast.def_id id) -> uint {
ret count;
}
-fn native_fn_wrapper_type(@crate_ctxt cx, uint ty_param_count, @ty.t x)
+fn native_fn_wrapper_type(@crate_ctxt cx, uint ty_param_count, ty.t x)
-> TypeRef {
alt (ty.struct(x)) {
case (ty.ty_native_fn(?abi, ?args, ?out)) {
@@ -6551,7 +6551,7 @@ fn decl_native_fn_and_pair(@crate_ctxt ccx,
fn push_arg(@block_ctxt cx,
&mutable vec[ValueRef] args,
ValueRef v,
- @ty.t t) {
+ ty.t t) {
if (ty.type_is_integral(t)) {
auto lldsttype = T_int();
auto llsrctype = type_of(cx.fcx.lcx.ccx, t);
@@ -7502,9 +7502,9 @@ fn trans_crate(session.session sess, @ast.crate crate, @ty.type_store tystore,
auto glues = make_glues(llmod, tn);
auto hasher = ty.hash_ty;
auto eqer = ty.eq_ty;
- auto tag_sizes = map.mk_hashmap[@ty.t,uint](hasher, eqer);
- auto tydescs = map.mk_hashmap[@ty.t,@tydesc_info](hasher, eqer);
- auto lltypes = map.mk_hashmap[@ty.t,TypeRef](hasher, eqer);
+ auto tag_sizes = map.mk_hashmap[ty.t,uint](hasher, eqer);
+ auto tydescs = map.mk_hashmap[ty.t,@tydesc_info](hasher, eqer);
+ auto lltypes = map.mk_hashmap[ty.t,TypeRef](hasher, eqer);
auto ccx = @rec(sess = sess,
llmod = llmod,
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index 42b6c908..eca80aff 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -21,18 +21,18 @@ import util.typestate_ann.ts_ann;
// Data types
-type arg = rec(ast.mode mode, @t ty);
+type arg = rec(ast.mode mode, t ty);
type field = rec(ast.ident ident, mt mt);
type method = rec(ast.proto proto,
ast.ident ident,
vec[arg] inputs,
- @t output);
+ t output);
-type mt = rec(@t ty, ast.mutability mut);
+type mt = rec(t ty, ast.mutability mut);
// Convert from method type to function type. Pretty easy; we just drop
// 'ident'.
-fn method_ty_to_fn_ty(@type_store tystore, method m) -> @ty.t {
+fn method_ty_to_fn_ty(@type_store tystore, method m) -> t {
ret mk_fn(tystore, m.proto, m.inputs, m.output);
}
@@ -42,7 +42,8 @@ fn method_ty_to_fn_ty(@type_store tystore, method m) -> @ty.t {
//
// TODO: It'd be really nice to be able to hide this definition from the
// outside world, to enforce the above invariants.
-type t = rec(sty struct, option.t[str] cname, uint hash);
+type raw_t = rec(sty struct, option.t[str] cname, uint hash);
+type t = @raw_t;
// NB: If you change this, you'll probably want to change the corresponding
// AST structure in front/ast.rs as well.
@@ -55,16 +56,16 @@ tag sty {
ty_machine(util.common.ty_mach);
ty_char;
ty_str;
- ty_tag(ast.def_id, vec[@t]);
+ ty_tag(ast.def_id, vec[t]);
ty_box(mt);
ty_vec(mt);
- ty_port(@t);
- ty_chan(@t);
+ ty_port(t);
+ ty_chan(t);
ty_task;
ty_tup(vec[mt]);
ty_rec(vec[field]);
- ty_fn(ast.proto, vec[arg], @t);
- ty_native_fn(ast.native_abi, vec[arg], @t);
+ ty_fn(ast.proto, vec[arg], t);
+ ty_native_fn(ast.native_abi, vec[arg], t);
ty_obj(vec[method]);
ty_var(int); // ephemeral type var
ty_local(ast.def_id); // type of a local var
@@ -72,15 +73,15 @@ tag sty {
ty_bound_param(uint); // bound param, only paths
ty_type;
ty_native;
- // TODO: ty_fn_arg(@t), for a possibly-aliased function argument
+ // TODO: ty_fn_arg(t), for a possibly-aliased function argument
}
// Data structures used in type unification
type unify_handler = obj {
- fn resolve_local(ast.def_id id) -> option.t[@t];
- fn record_local(ast.def_id id, @t ty); // TODO: -> Unify.result
- fn record_param(uint index, @t binding) -> Unify.result;
+ fn resolve_local(ast.def_id id) -> option.t[t];
+ fn record_local(ast.def_id id, t ty); // TODO: -> Unify.result
+ fn record_param(uint index, t binding) -> Unify.result;
};
tag type_err {
@@ -98,36 +99,36 @@ tag type_err {
}
-type ty_param_count_and_ty = tup(uint, @t);
+type ty_param_count_and_ty = tup(uint, t);
type type_cache = hashmap[ast.def_id,ty_param_count_and_ty];
-type type_store = hashmap[@t,@t];
+type type_store = hashmap[t,t];
fn mk_type_store() -> @type_store {
auto hasher = hash_ty;
auto eqer = eq_ty_full;
- ret @map.mk_hashmap[@t,@t](hasher, eqer);
+ ret @map.mk_hashmap[t,t](hasher, eqer);
}
// Type constructors
// These are private constructors to this module. External users should always
// use the mk_foo() functions below.
-fn gen_ty(@type_store tystore, &sty st) -> @t {
+fn gen_ty(@type_store tystore, &sty st) -> t {
ret gen_ty_full(tystore, st, none[str]);
}
-fn gen_ty_full(@type_store tystore, &sty st, option.t[str] cname) -> @t {
+fn gen_ty_full(@type_store tystore, &sty st, option.t[str] cname) -> t {
auto h = hash_type_structure(st);
auto new_type = @rec(struct=st, cname=cname, hash=h);
// Is it interned?
alt (tystore.find(new_type)) {
- case (some[@t](?typ)) {
+ case (some[t](?typ)) {
ret typ;
}
- case (none[@t]) {
+ case (none[t]) {
// Nope. Insert it and return.
tystore.insert(new_type, new_type);
ret new_type;
@@ -135,86 +136,86 @@ fn gen_ty_full(@type_store tystore, &sty st, option.t[str] cname) -> @t {
}
}
-fn mk_nil(@type_store ts) -> @t { ret gen_ty(ts, ty_nil); }
-fn mk_bool(@type_store ts) -> @t { ret gen_ty(ts, ty_bool); }
-fn mk_int(@type_store ts) -> @t { ret gen_ty(ts, ty_int); }
-fn mk_float(@type_store ts) -> @t { ret gen_ty(ts, ty_float); }
-fn mk_uint(@type_store ts) -> @t { ret gen_ty(ts, ty_uint); }
+fn mk_nil(@type_store ts) -> t { ret gen_ty(ts, ty_nil); }
+fn mk_bool(@type_store ts) -> t { ret gen_ty(ts, ty_bool); }
+fn mk_int(@type_store ts) -> t { ret gen_ty(ts, ty_int); }
+fn mk_float(@type_store ts) -> t { ret gen_ty(ts, ty_float); }
+fn mk_uint(@type_store ts) -> t { ret gen_ty(ts, ty_uint); }
-fn mk_mach(@type_store ts, util.common.ty_mach tm) -> @t {
+fn mk_mach(@type_store ts, util.common.ty_mach tm) -> t {
ret gen_ty(ts, ty_machine(tm));
}
-fn mk_char(@type_store ts) -> @t { ret gen_ty(ts, ty_char); }
-fn mk_str(@type_store ts) -> @t { ret gen_ty(ts, ty_str); }
+fn mk_char(@type_store ts) -> t { ret gen_ty(ts, ty_char); }
+fn mk_str(@type_store ts) -> t { ret gen_ty(ts, ty_str); }
-fn mk_tag(@type_store ts, ast.def_id did, vec[@t] tys) -> @t {
+fn mk_tag(@type_store ts, ast.def_id did, vec[t] tys) -> t {
ret gen_ty(ts, ty_tag(did, tys));
}
-fn mk_box(@type_store ts, mt tm) -> @t {
+fn mk_box(@type_store ts, mt tm) -> t {
ret gen_ty(ts, ty_box(tm));
}
-fn mk_imm_box(@type_store ts, @t ty) -> @t {
+fn mk_imm_box(@type_store ts, t ty) -> t {
ret mk_box(ts, rec(ty=ty, mut=ast.imm));
}
-fn mk_vec(@type_store ts, mt tm) -> @t { ret gen_ty(ts, ty_vec(tm)); }
-fn mk_port(@type_store ts, @t ty) -> @t { ret gen_ty(ts, ty_port(ty)); }
-fn mk_chan(@type_store ts, @t ty) -> @t { ret gen_ty(ts, ty_chan(ty)); }
-fn mk_task(@type_store ts) -> @t { ret gen_ty(ts, ty_task); }
+fn mk_vec(@type_store ts, mt tm) -> t { ret gen_ty(ts, ty_vec(tm)); }
+fn mk_port(@type_store ts, t ty) -> t { ret gen_ty(ts, ty_port(ty)); }
+fn mk_chan(@type_store ts, t ty) -> t { ret gen_ty(ts, ty_chan(ty)); }
+fn mk_task(@type_store ts) -> t { ret gen_ty(ts, ty_task); }
-fn mk_tup(@type_store ts, vec[mt] tms) -> @t {
+fn mk_tup(@type_store ts, vec[mt] tms) -> t {
ret gen_ty(ts, ty_tup(tms));
}
-fn mk_imm_tup(@type_store ts, vec[@t] tys) -> @t {
+fn mk_imm_tup(@type_store ts, vec[t] tys) -> t {
// TODO: map
let vec[ty.mt] mts = vec();
- for (@ty.t typ in tys) {
+ for (t typ in tys) {
mts += vec(rec(ty=typ, mut=ast.imm));
}
ret mk_tup(ts, mts);
}
-fn mk_rec(@type_store ts, vec[field] fs) -> @t {
+fn mk_rec(@type_store ts, vec[field] fs) -> t {
ret gen_ty(ts, ty_rec(fs));
}
-fn mk_fn(@type_store ts, ast.proto proto, vec[arg] args, @t ty) -> @t {
+fn mk_fn(@type_store ts, ast.proto proto, vec[arg] args, t ty) -> t {
ret gen_ty(ts, ty_fn(proto, args, ty));
}
-fn mk_native_fn(@type_store ts, ast.native_abi abi, vec[arg] args, @t ty)
- -> @t {
+fn mk_native_fn(@type_store ts, ast.native_abi abi, vec[arg] args, t ty)
+ -> t {
ret gen_ty(ts, ty_native_fn(abi, args, ty));
}
-fn mk_obj(@type_store ts, vec[method] meths) -> @t {
+fn mk_obj(@type_store ts, vec[method] meths) -> t {
ret gen_ty(ts, ty_obj(meths));
}
-fn mk_var(@type_store ts, int v) -> @t { ret gen_ty(ts, ty_var(v)); }
+fn mk_var(@type_store ts, int v) -> t { ret gen_ty(ts, ty_var(v)); }
-fn mk_local(@type_store ts, ast.def_id did) -> @t {
+fn mk_local(@type_store ts, ast.def_id did) -> t {
ret gen_ty(ts, ty_local(did));
}
-fn mk_param(@type_store ts, uint n) -> @t {
+fn mk_param(@type_store ts, uint n) -> t {
ret gen_ty(ts, ty_param(n));
}
-fn mk_bound_param(@type_store ts, uint n) -> @t {
+fn mk_bound_param(@type_store ts, uint n) -> t {
ret gen_ty(ts, ty_bound_param(n));
}
-fn mk_type(@type_store ts) -> @t { ret gen_ty(ts, ty_type); }
-fn mk_native(@type_store ts) -> @t { ret gen_ty(ts, ty_native); }
+fn mk_type(@type_store ts) -> t { ret gen_ty(ts, ty_type); }
+fn mk_native(@type_store ts) -> t { ret gen_ty(ts, ty_native); }
// Returns the one-level-deep type structure of the given type.
-fn struct(@t typ) -> sty { ret typ.struct; }
+fn struct(t typ) -> sty { ret typ.struct; }
// Stringification
@@ -230,9 +231,9 @@ fn path_to_str(&ast.path pth) -> str {
ret result;
}
-fn ty_to_str(&@t typ) -> str {
+fn ty_to_str(&t typ) -> str {
- fn fn_input_to_str(&rec(ast.mode mode, @t ty) input) -> str {
+ fn fn_input_to_str(&rec(ast.mode mode, t ty) input) -> str {
auto s;
if (mode_is_alias(input.mode)) {
s = "&";
@@ -245,7 +246,7 @@ fn ty_to_str(&@t typ) -> str {
fn fn_to_str(ast.proto proto,
option.t[ast.ident] ident,
- vec[arg] inputs, @t output) -> str {
+ vec[arg] inputs, t output) -> str {
auto f = fn_input_to_str;
auto s;
@@ -329,9 +330,9 @@ fn ty_to_str(&@t typ) -> str {
// The user should never see this if the cname is set properly!
s += "<tag#" + util.common.istr(id._0) + ":" +
util.common.istr(id._1) + ">";
- if (_vec.len[@t](tps) > 0u) {
+ if (_vec.len[t](tps) > 0u) {
auto f = ty_to_str;
- auto strs = _vec.map[@t,str](f, tps);
+ auto strs = _vec.map[t,str](f, tps);
s += "[" + _str.connect(strs, ",") + "]";
}
}
@@ -380,9 +381,9 @@ fn ty_to_str(&@t typ) -> str {
// Type folds
-type ty_walk = fn(@t);
+type ty_walk = fn(t);
-fn walk_ty(ty_walk walker, @t ty) {
+fn walk_ty(ty_walk walker, t ty) {
alt (struct(ty)) {
case (ty_nil) { /* no-op */ }
case (ty_bool) { /* no-op */ }
@@ -399,7 +400,7 @@ fn walk_ty(ty_walk walker, @t ty) {
case (ty_port(?subty)) { walk_ty(walker, subty); }
case (ty_chan(?subty)) { walk_ty(walker, subty); }
case (ty_tag(?tid, ?subtys)) {
- for (@t subty in subtys) {
+ for (t subty in subtys) {
walk_ty(walker, subty);
}
}
@@ -443,9 +444,9 @@ fn walk_ty(ty_walk walker, @t ty) {
walker(ty);
}
-type ty_fold = fn(@t) -> @t;
+type ty_fold = fn(t) -> t;
-fn fold_ty(@type_store tystore, ty_fold fld, @t ty_0) -> @t {
+fn fold_ty(@type_store tystore, ty_fold fld, t ty_0) -> t {
auto ty = ty_0;
alt (struct(ty)) {
case (ty_nil) { /* no-op */ }
@@ -478,8 +479,8 @@ fn fold_ty(@type_store tystore, ty_fold fld, @t ty_0) -> @t {
mk_chan(tystore, fold_ty(tystore, fld, subty)), ty);
}
case (ty_tag(?tid, ?subtys)) {
- let vec[@t] new_subtys = vec();
- for (@t subty in subtys) {
+ let vec[t] new_subtys = vec();
+ for (t subty in subtys) {
new_subtys += vec(fold_ty(tystore, fld, subty));
}
ty = copy_cname(tystore, mk_tag(tystore, tid, new_subtys), ty);
@@ -547,13 +548,13 @@ fn fold_ty(@type_store tystore, ty_fold fld, @t ty_0) -> @t {
// Type utilities
-fn rename(@type_store tystore, @t typ, str new_cname) -> @t {
+fn rename(@type_store tystore, t typ, str new_cname) -> t {
ret gen_ty_full(tystore, struct(typ), some[str](new_cname));
}
// Returns a type with the structural part taken from `struct_ty` and the
// canonical name from `cname_ty`.
-fn copy_cname(@type_store tystore, @t struct_ty, @t cname_ty) -> @t {
+fn copy_cname(@type_store tystore, t struct_ty, t cname_ty) -> t {
ret gen_ty_full(tystore, struct(struct_ty), cname_ty.cname);
}
@@ -566,7 +567,7 @@ fn mode_is_alias(ast.mode m) -> bool {
fail;
}
-fn type_is_nil(@t ty) -> bool {
+fn type_is_nil(t ty) -> bool {
alt (struct(ty)) {
case (ty_nil) { ret true; }
case (_) { ret false; }
@@ -574,7 +575,7 @@ fn type_is_nil(@t ty) -> bool {
fail;
}
-fn type_is_bool(@t ty) -> bool {
+fn type_is_bool(t ty) -> bool {
alt (struct(ty)) {
case (ty_bool) { ret true; }
case (_) { ret false; }
@@ -582,7 +583,7 @@ fn type_is_bool(@t ty) -> bool {
}
-fn type_is_structural(@t ty) -> bool {
+fn type_is_structural(t ty) -> bool {
alt (struct(ty)) {
case (ty_tup(_)) { ret true; }
case (ty_rec(_)) { ret true; }
@@ -594,7 +595,7 @@ fn type_is_structural(@t ty) -> bool {
fail;
}
-fn type_is_sequence(@t ty) -> bool {
+fn type_is_sequence(t ty) -> bool {
alt (struct(ty)) {
case (ty_str) { ret true; }
case (ty_vec(_)) { ret true; }
@@ -603,7 +604,7 @@ fn type_is_sequence(@t ty) -> bool {
fail;
}
-fn sequence_element_type(@type_store tystore, @t ty) -> @t {
+fn sequence_element_type(@type_store tystore, t ty) -> t {
alt (struct(ty)) {
case (ty_str) { ret mk_mach(tystore, common.ty_u8); }
case (ty_vec(?mt)) { ret mt.ty; }
@@ -612,7 +613,7 @@ fn sequence_element_type(@type_store tystore, @t ty) -> @t {
}
-fn type_is_tup_like(@t ty) -> bool {
+fn type_is_tup_like(t ty) -> bool {
alt (struct(ty)) {
case (ty_box(_)) { ret true; }
case (ty_tup(_)) { ret true; }
@@ -623,7 +624,7 @@ fn type_is_tup_like(@t ty) -> bool {
fail;
}
-fn get_element_type(@t ty, uint i) -> @t {
+fn get_element_type(t ty, uint i) -> t {
check (type_is_tup_like(ty));
alt (struct(ty)) {
case (ty_tup(?mts)) {
@@ -636,7 +637,7 @@ fn get_element_type(@t ty, uint i) -> @t {
fail;
}
-fn type_is_box(@t ty) -> bool {
+fn type_is_box(t ty) -> bool {
alt (struct(ty)) {
case (ty_box(_)) { ret true; }
case (_) { ret false; }
@@ -644,7 +645,7 @@ fn type_is_box(@t ty) -> bool {
fail;
}
-fn type_is_boxed(@t ty) -> bool {
+fn type_is_boxed(t ty) -> bool {
alt (struct(ty)) {
case (ty_str) { ret true; }
case (ty_vec(_)) { ret true; }
@@ -656,7 +657,7 @@ fn type_is_boxed(@t ty) -> bool {
fail;
}
-fn type_is_scalar(@t ty) -> bool {
+fn type_is_scalar(t ty) -> bool {
alt (struct(ty)) {
case (ty_nil) { ret true; }
case (ty_bool) { ret true; }
@@ -674,7 +675,7 @@ fn type_is_scalar(@t ty) -> bool {
// FIXME: should we just return true for native types in
// type_is_scalar?
-fn type_is_native(@t ty) -> bool {
+fn type_is_native(t ty) -> bool {
alt (struct(ty)) {
case (ty_native) { ret true; }
case (_) { ret false; }
@@ -682,7 +683,7 @@ fn type_is_native(@t ty) -> bool {
fail;
}
-fn type_has_dynamic_size(@t ty) -> bool {
+fn type_has_dynamic_size(t ty) -> bool {
alt (struct(ty)) {
case (ty_tup(?mts)) {
auto i = 0u;
@@ -700,7 +701,7 @@ fn type_has_dynamic_size(@t ty) -> bool {
}
case (ty_tag(_, ?subtys)) {
auto i = 0u;
- while (i < _vec.len[@t](subtys)) {
+ while (i < _vec.len[t](subtys)) {
if (type_has_dynamic_size(subtys.(i))) { ret true; }
i += 1u;
}
@@ -711,7 +712,7 @@ fn type_has_dynamic_size(@t ty) -> bool {
ret false;
}
-fn type_is_integral(@t ty) -> bool {
+fn type_is_integral(t ty) -> bool {
alt (struct(ty)) {
case (ty_int) { ret true; }
case (ty_uint) { ret true; }
@@ -735,7 +736,7 @@ fn type_is_integral(@t ty) -> bool {
fail;
}
-fn type_is_fp(@t ty) -> bool {
+fn type_is_fp(t ty) -> bool {
alt (struct(ty)) {
case (ty_machine(?tm)) {
alt (tm) {
@@ -752,7 +753,7 @@ fn type_is_fp(@t ty) -> bool {
fail;
}
-fn type_is_signed(@t ty) -> bool {
+fn type_is_signed(t ty) -> bool {
alt (struct(ty)) {
case (ty_int) { ret true; }
case (ty_machine(?tm)) {
@@ -769,7 +770,7 @@ fn type_is_signed(@t ty) -> bool {
fail;
}
-fn type_param(@t ty) -> option.t[uint] {
+fn type_param(t ty) -> option.t[uint] {
alt (struct(ty)) {
case (ty_param(?id)) { ret some[uint](id); }
case (_) { /* fall through */ }
@@ -797,13 +798,13 @@ fn hash_type_structure(&sty st) -> uint {
ret h;
}
- fn hash_subty(uint id, @t subty) -> uint {
+ fn hash_subty(uint id, t subty) -> uint {
auto h = id;
h += h << 5u + hash_ty(subty);
ret h;
}
- fn hash_fn(uint id, vec[arg] args, @t rty) -> uint {
+ fn hash_fn(uint id, vec[arg] args, t rty) -> uint {
auto h = id;
for (arg a in args) {
h += h << 5u + hash_ty(a.ty);
@@ -838,7 +839,7 @@ fn hash_type_structure(&sty st) -> uint {
case (ty_str) { ret 16u; }
case (ty_tag(?did, ?tys)) {
auto h = hash_def(17u, did);
- for (@ty.t typ in tys) {
+ for (t typ in tys) {
h += h << 5u + hash_ty(typ);
}
ret h;
@@ -880,13 +881,13 @@ fn hash_type_structure(&sty st) -> uint {
}
}
-fn hash_ty(&@t typ) -> uint { ret typ.hash; }
+fn hash_ty(&t typ) -> uint { ret typ.hash; }
// Type equality. This function is private to this module (and slow); external
// users should use `eq_ty()` instead.
fn equal_type_structures(&sty a, &sty b) -> bool {
- fn equal_ty(@t a, @t b) -> bool { ret Box.ptr_eq[t](a, b); }
+ fn equal_ty(t a, t b) -> bool { ret Box.ptr_eq[raw_t](a, b); }
fn equal_proto(ast.proto a, ast.proto b) -> bool {
alt (a) {
@@ -972,8 +973,8 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
ret equal_mut(a.mut, b.mut) && equal_ty(a.ty, b.ty);
}
- fn equal_fn(vec[arg] args_a, @t rty_a,
- vec[arg] args_b, @t rty_b) -> bool {
+ fn equal_fn(vec[arg] args_a, t rty_a,
+ vec[arg] args_b, t rty_b) -> bool {
if (!equal_ty(rty_a, rty_b)) { ret false; }
auto len = _vec.len[arg](args_a);
@@ -1050,8 +1051,8 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
case (ty_tag(?id_b, ?tys_b)) {
if (!equal_def(id_a, id_b)) { ret false; }
- auto len = _vec.len[@ty.t](tys_a);
- if (len != _vec.len[@ty.t](tys_b)) { ret false; }
+ auto len = _vec.len[t](tys_a);
+ if (len != _vec.len[t](tys_b)) { ret false; }
auto i = 0u;
while (i < len) {
if (!equal_ty(tys_a.(i), tys_b.(i))) { ret false; }
@@ -1206,7 +1207,7 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
// An expensive type equality function. This function is private to this
// module.
-fn eq_ty_full(&@t a, &@t b) -> bool {
+fn eq_ty_full(&t a, &t b) -> bool {
// Check hashes (fast path).
if (a.hash != b.hash) {
ret false;
@@ -1236,10 +1237,10 @@ fn eq_ty_full(&@t a, &@t b) -> bool {
// This is the equality function the public should use. It works as long as
// the types are interned.
-fn eq_ty(&@t a, &@t b) -> bool { ret Box.ptr_eq[t](a, b); }
+fn eq_ty(&t a, &t b) -> bool { ret Box.ptr_eq[raw_t](a, b); }
-fn ann_to_type(&ast.ann ann) -> @t {
+fn ann_to_type(&ast.ann ann) -> t {
alt (ann) {
case (ast.ann_none) {
log_err "ann_to_type() called on node with no type";
@@ -1251,7 +1252,7 @@ fn ann_to_type(&ast.ann ann) -> @t {
}
}
-fn ann_to_type_params(&ast.ann ann) -> vec[@t] {
+fn ann_to_type_params(&ast.ann ann) -> vec[t] {
alt (ann) {
case (ast.ann_none) {
log_err "ann_to_type_params() called on node with no type params";
@@ -1259,11 +1260,11 @@ fn ann_to_type_params(&ast.ann ann) -> vec[@t] {
}
case (ast.ann_type(_, ?tps, _)) {
alt (tps) {
- case (none[vec[@ty.t]]) {
- let vec[@t] result = vec();
+ case (none[vec[t]]) {
+ let vec[t] result = vec();
ret result;
}
- case (some[vec[@ty.t]](?tps)) { ret tps; }
+ case (some[vec[t]](?tps)) { ret tps; }
}
}
}
@@ -1271,7 +1272,7 @@ fn ann_to_type_params(&ast.ann ann) -> vec[@t] {
// Returns the type of an annotation, with type parameter substitutions
// performed if applicable.
-fn ann_to_monotype(@type_store tystore, ast.ann a) -> @ty.t {
+fn ann_to_monotype(@type_store tystore, ast.ann a) -> t {
// TODO: Refactor to use recursive pattern matching when we're more
// confident that it works.
alt (a) {
@@ -1281,8 +1282,8 @@ fn ann_to_monotype(@type_store tystore, ast.ann a) -> @ty.t {
}
case (ast.ann_type(?typ, ?tps_opt, _)) {
alt (tps_opt) {
- case (none[vec[@ty.t]]) { ret typ; }
- case (some[vec[@ty.t]](?tps)) {
+ case (none[vec[t]]) { ret typ; }
+ case (some[vec[t]](?tps)) {
ret substitute_type_params(tystore, tps, typ);
}
}
@@ -1291,13 +1292,13 @@ fn ann_to_monotype(@type_store tystore, ast.ann a) -> @ty.t {
}
// Turns a type into an ann_type, using defaults for other fields.
-fn triv_ann(@ty.t typ) -> ast.ann {
- ret ast.ann_type(typ, none[vec[@ty.t]], none[@ts_ann]);
+fn triv_ann(t typ) -> ast.ann {
+ ret ast.ann_type(typ, none[vec[t]], none[@ts_ann]);
}
// Returns the number of distinct type parameters in the given type.
-fn count_ty_params(@t ty) -> uint {
- fn counter(@mutable vec[uint] param_indices, @t ty) {
+fn count_ty_params(t ty) -> uint {
+ fn counter(@mutable vec[uint] param_indices, t ty) {
alt (struct(ty)) {
case (ty_param(?param_idx)) {
auto seen = false;
@@ -1321,8 +1322,8 @@ fn count_ty_params(@t ty) -> uint {
ret _vec.len[uint](*param_indices);
}
-fn type_contains_vars(@t typ) -> bool {
- fn checker(@mutable bool flag, @t typ) {
+fn type_contains_vars(t typ) -> bool {
+ fn checker(@mutable bool flag, t typ) {
alt (struct(typ)) {
case (ty_var(_)) { *flag = true; }
case (_) { /* fall through */ }
@@ -1337,7 +1338,7 @@ fn type_contains_vars(@t typ) -> bool {
// Type accessors for substructures of types
-fn ty_fn_args(@t fty) -> vec[arg] {
+fn ty_fn_args(t fty) -> vec[arg] {
alt (struct(fty)) {
case (ty.ty_fn(_, ?a, _)) { ret a; }
case (ty.ty_native_fn(_, ?a, _)) { ret a; }
@@ -1345,21 +1346,21 @@ fn ty_fn_args(@t fty) -> vec[arg] {
fail;
}
-fn ty_fn_proto(@t fty) -> ast.proto {
+fn ty_fn_proto(t fty) -> ast.proto {
alt (struct(fty)) {
case (ty.ty_fn(?p, _, _)) { ret p; }
}
fail;
}
-fn ty_fn_abi(@t fty) -> ast.native_abi {
+fn ty_fn_abi(t fty) -> ast.native_abi {
alt (struct(fty)) {
case (ty.ty_native_fn(?a, _, _)) { ret a; }
}
fail;
}
-fn ty_fn_ret(@t fty) -> @t {
+fn ty_fn_ret(t fty) -> t {
alt (struct(fty)) {
case (ty.ty_fn(_, _, ?r)) { ret r; }
case (ty.ty_native_fn(_, _, ?r)) { ret r; }
@@ -1367,7 +1368,7 @@ fn ty_fn_ret(@t fty) -> @t {
fail;
}
-fn is_fn_ty(@t fty) -> bool {
+fn is_fn_ty(t fty) -> bool {
alt (struct(fty)) {
case (ty.ty_fn(_, _, _)) { ret true; }
case (ty.ty_native_fn(_, _, _)) { ret true; }
@@ -1425,7 +1426,7 @@ fn item_ty(@ast.item it) -> ty_param_count_and_ty {
ret tup(ty_param_count, result_ty);
}
-fn stmt_ty(@type_store tystore, @ast.stmt s) -> @t {
+fn stmt_ty(@type_store tystore, @ast.stmt s) -> t {
alt (s.node) {
case (ast.stmt_expr(?e,_)) {
ret expr_ty(tystore, e);
@@ -1436,7 +1437,7 @@ fn stmt_ty(@type_store tystore, @ast.stmt s) -> @t {
}
}
-fn block_ty(@type_store tystore, &ast.block b) -> @t {
+fn block_ty(@type_store tystore, &ast.block b) -> t {
alt (b.node.expr) {
case (some[@ast.expr](?e)) { ret expr_ty(tystore, e); }
case (none[@ast.expr]) { ret mk_nil(tystore); }
@@ -1445,7 +1446,7 @@ fn block_ty(@type_store tystore, &ast.block b) -> @t {
// Returns the type of a pattern as a monotype. Like @expr_ty, this function
// doesn't provide type parameter substitutions.
-fn pat_ty(@type_store ts, @ast.pat pat) -> @t {
+fn pat_ty(@type_store ts, @ast.pat pat) -> t {
alt (pat.node) {
case (ast.pat_wild(?ann)) { ret ann_to_monotype(ts, ann); }
case (ast.pat_lit(_, ?ann)) { ret ann_to_monotype(ts, ann); }
@@ -1507,7 +1508,7 @@ fn expr_ann(@ast.expr expr) -> option.t[ast.ann] {
// ask for the type of "id" in "id(3)", it will return "fn(&int) -> int"
// instead of "fn(&T) -> T with T = int". If this isn't what you want, see
// expr_ty_params_and_ty() below.
-fn expr_ty(@type_store tystore, @ast.expr expr) -> @t {
+fn expr_ty(@type_store tystore, @ast.expr expr) -> t {
alt (expr_ann(expr)) {
case (none[ast.ann]) { ret mk_nil(tystore); }
case (some[ast.ann](?a)) { ret ann_to_monotype(tystore, a); }
@@ -1515,10 +1516,10 @@ fn expr_ty(@type_store tystore, @ast.expr expr) -> @t {
}
fn expr_ty_params_and_ty(@type_store tystore, @ast.expr expr)
- -> tup(vec[@t], @t) {
+ -> tup(vec[t], t) {
alt (expr_ann(expr)) {
case (none[ast.ann]) {
- let vec[@t] tps = vec();
+ let vec[t] tps = vec();
ret tup(tps, mk_nil(tystore));
}
case (some[ast.ann](?a)) {
@@ -1535,7 +1536,7 @@ fn expr_has_ty_params(@ast.expr expr) -> bool {
alt (a) {
case (ast.ann_none) { fail; }
case (ast.ann_type(_, ?tps_opt, _)) {
- ret !option.is_none[vec[@t]](tps_opt);
+ ret !option.is_none[vec[t]](tps_opt);
}
}
}
@@ -1543,12 +1544,12 @@ fn expr_has_ty_params(@ast.expr expr) -> bool {
}
// FIXME: At the moment this works only for call, bind, and path expressions.
-fn replace_expr_type(@ast.expr expr, tup(vec[@t], @t) new_tyt) -> @ast.expr {
+fn replace_expr_type(@ast.expr expr, tup(vec[t], t) new_tyt) -> @ast.expr {
auto new_tps;
if (expr_has_ty_params(expr)) {
- new_tps = some[vec[@t]](new_tyt._0);
+ new_tps = some[vec[t]](new_tyt._0);
} else {
- new_tps = none[vec[@t]];
+ new_tps = none[vec[t]];
}
auto ann = ast.ann_type(new_tyt._1, new_tps, none[@ts_ann]);
@@ -1662,13 +1663,13 @@ fn is_lval(@ast.expr expr) -> bool {
mod Unify {
tag result {
- ures_ok(@ty.t);
- ures_err(type_err, @ty.t, @ty.t);
+ ures_ok(t);
+ ures_err(type_err, t, t);
}
type ctxt = rec(UFind.ufind sets,
hashmap[int,uint] var_ids,
- mutable vec[mutable vec[@t]] types,
+ mutable vec[mutable vec[t]] types,
unify_handler handler,
@type_store tystore);
@@ -1680,7 +1681,7 @@ mod Unify {
// something we'll probably need to develop over time.
// Simple structural type comparison.
- fn struct_cmp(@ty.t expected, @ty.t actual) -> result {
+ fn struct_cmp(t expected, t actual) -> result {
if (struct(expected) == struct(actual)) {
ret ures_ok(expected);
}
@@ -1705,14 +1706,14 @@ mod Unify {
tag fn_common_res {
fn_common_res_err(result);
- fn_common_res_ok(vec[arg], @t);
+ fn_common_res_ok(vec[arg], t);
}
fn unify_fn_common(@ctxt cx,
- @ty.t expected,
- @ty.t actual,
- vec[arg] expected_inputs, @t expected_output,
- vec[arg] actual_inputs, @t actual_output)
+ t expected,
+ t actual,
+ vec[arg] expected_inputs, t expected_output,
+ vec[arg] actual_inputs, t actual_output)
-> fn_common_res {
auto expected_len = _vec.len[arg](expected_inputs);
auto actual_len = _vec.len[arg](actual_inputs);
@@ -1768,10 +1769,10 @@ mod Unify {
fn unify_fn(@ctxt cx,
ast.proto e_proto,
ast.proto a_proto,
- @ty.t expected,
- @ty.t actual,
- vec[arg] expected_inputs, @t expected_output,
- vec[arg] actual_inputs, @t actual_output)
+ t expected,
+ t actual,
+ vec[arg] expected_inputs, t expected_output,
+ vec[arg] actual_inputs, t actual_output)
-> result {
if (e_proto != a_proto) {
@@ -1794,10 +1795,10 @@ mod Unify {
fn unify_native_fn(@ctxt cx,
ast.native_abi e_abi,
ast.native_abi a_abi,
- @ty.t expected,
- @ty.t actual,
- vec[arg] expected_inputs, @t expected_output,
- vec[arg] actual_inputs, @t actual_output)
+ t expected,
+ t actual,
+ vec[arg] expected_inputs, t expected_output,
+ vec[arg] actual_inputs, t actual_output)
-> result {
if (e_abi != a_abi) {
ret ures_err(terr_mismatch, expected, actual);
@@ -1819,8 +1820,8 @@ mod Unify {
}
fn unify_obj(@ctxt cx,
- @ty.t expected,
- @ty.t actual,
+ t expected,
+ t actual,
vec[method] expected_meths,
vec[method] actual_meths) -> result {
let vec[method] result_meths = vec();
@@ -1876,7 +1877,7 @@ mod Unify {
ret set_num;
}
- fn unify_step(@ctxt cx, @ty.t expected, @ty.t actual) -> result {
+ fn unify_step(@ctxt cx, t expected, t actual) -> result {
// TODO: rewrite this using tuple pattern matching when available, to
// avoid all this rightward drift and spikiness.
@@ -1899,7 +1900,7 @@ mod Unify {
case (_) {
// Just bind the type variable to the expected type.
- auto vlen = _vec.len[mutable vec[@t]](cx.types);
+ auto vlen = _vec.len[mutable vec[t]](cx.types);
if (actual_n < vlen) {
cx.types.(actual_n) += vec(expected);
} else {
@@ -1913,8 +1914,8 @@ mod Unify {
case (ty.ty_local(?actual_id)) {
auto result_ty;
alt (cx.handler.resolve_local(actual_id)) {
- case (none[@ty.t]) { result_ty = expected; }
- case (some[@ty.t](?actual_ty)) {
+ case (none[t]) { result_ty = expected; }
+ case (some[t](?actual_ty)) {
auto result = unify_step(cx, expected, actual_ty);
alt (result) {
case (ures_ok(?rty)) { result_ty = rty; }
@@ -1964,9 +1965,9 @@ mod Unify {
// TODO: factor this cruft out, see the TODO in the
// ty.ty_tup case
- let vec[@ty.t] result_tps = vec();
+ let vec[t] result_tps = vec();
auto i = 0u;
- auto expected_len = _vec.len[@ty.t](expected_tps);
+ auto expected_len = _vec.len[t](expected_tps);
while (i < expected_len) {
auto expected_tp = expected_tps.(i);
auto actual_tp = actual_tps.(i);
@@ -1977,7 +1978,7 @@ mod Unify {
alt (result) {
case (ures_ok(?rty)) {
- _vec.push[@ty.t](result_tps, rty);
+ _vec.push[t](result_tps, rty);
}
case (_) {
ret result;
@@ -2268,7 +2269,7 @@ mod Unify {
case (ty.ty_var(?expected_id)) {
// Add a binding.
auto expected_n = get_or_create_set(cx, expected_id);
- auto vlen = _vec.len[mutable vec[@t]](cx.types);
+ auto vlen = _vec.len[mutable vec[t]](cx.types);
if (expected_n < vlen) {
cx.types.(expected_n) += vec(actual);
} else {
@@ -2281,8 +2282,8 @@ mod Unify {
case (ty.ty_local(?expected_id)) {
auto result_ty;
alt (cx.handler.resolve_local(expected_id)) {
- case (none[@ty.t]) { result_ty = actual; }
- case (some[@ty.t](?expected_ty)) {
+ case (none[t]) { result_ty = actual; }
+ case (some[t](?expected_ty)) {
auto result = unify_step(cx, expected_ty, actual);
alt (result) {
case (ures_ok(?rty)) { result_ty = rty; }
@@ -2305,8 +2306,8 @@ mod Unify {
}
// Performs type binding substitution.
- fn substitute(@ctxt cx, vec[@t] set_types, @t typ) -> @t {
- fn substituter(@ctxt cx, vec[@t] types, @t typ) -> @t {
+ fn substitute(@ctxt cx, vec[t] set_types, t typ) -> t {
+ fn substituter(@ctxt cx, vec[t] types, t typ) -> t {
alt (struct(typ)) {
case (ty_var(?id)) {
alt (cx.var_ids.find(id)) {
@@ -2325,26 +2326,26 @@ mod Unify {
ret fold_ty(cx.tystore, f, typ);
}
- fn unify_sets(@ctxt cx) -> vec[@t] {
- let vec[@t] throwaway = vec();
- let vec[mutable vec[@t]] set_types = vec(mutable throwaway);
- _vec.pop[mutable vec[@t]](set_types); // FIXME: botch
+ fn unify_sets(@ctxt cx) -> vec[t] {
+ let vec[t] throwaway = vec();
+ let vec[mutable vec[t]] set_types = vec(mutable throwaway);
+ _vec.pop[mutable vec[t]](set_types); // FIXME: botch
for (UFind.node node in cx.sets.nodes) {
- let vec[@t] v = vec();
+ let vec[t] v = vec();
set_types += vec(mutable v);
}
auto i = 0u;
- while (i < _vec.len[mutable vec[@t]](set_types)) {
+ while (i < _vec.len[mutable vec[t]](set_types)) {
auto root = UFind.find(cx.sets, i);
set_types.(root) += cx.types.(i);
i += 1u;
}
- let vec[@t] result = vec();
- for (vec[@t] types in set_types) {
- if (_vec.len[@t](types) > 1u) {
+ let vec[t] result = vec();
+ for (vec[t] types in set_types) {
+ if (_vec.len[t](types) > 1u) {
log_err "unification of > 1 types in a type set is " +
"unimplemented";
fail;
@@ -2355,13 +2356,13 @@ mod Unify {
ret result;
}
- fn unify(@ty.t expected,
- @ty.t actual,
+ fn unify(t expected,
+ t actual,
&unify_handler handler,
@type_store tystore) -> result {
- let vec[@t] throwaway = vec();
- let vec[mutable vec[@t]] types = vec(mutable throwaway);
- _vec.pop[mutable vec[@t]](types); // FIXME: botch
+ let vec[t] throwaway = vec();
+ let vec[mutable vec[t]] types = vec(mutable throwaway);
+ _vec.pop[mutable vec[t]](types); // FIXME: botch
auto cx = @rec(sets=UFind.make(),
var_ids=common.new_int_hash[uint](),
@@ -2437,9 +2438,9 @@ fn type_err_to_str(&ty.type_err err) -> str {
// Performs bound type parameter replacement using the supplied mapping from
// parameter IDs to types.
fn substitute_type_params(@type_store tystore,
- vec[@t] bindings,
- @t typ) -> @t {
- fn replacer(vec[@t] bindings, @t typ) -> @t {
+ vec[t] bindings,
+ t typ) -> t {
+ fn replacer(vec[t] bindings, t typ) -> t {
alt (struct(typ)) {
case (ty_bound_param(?param_index)) {
ret bindings.(param_index);
@@ -2453,8 +2454,8 @@ fn substitute_type_params(@type_store tystore,
}
// Converts type parameters in a type to bound type parameters.
-fn bind_params_in_type(@type_store tystore, @t typ) -> @t {
- fn binder(@type_store tystore, @t typ) -> @t {
+fn bind_params_in_type(@type_store tystore, t typ) -> t {
+ fn binder(@type_store tystore, t typ) -> t {
alt (struct(typ)) {
case (ty_bound_param(?index)) {
log_err "bind_params_in_type() called on type that already " +
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs
index 6d2e06e0..b6729989 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -43,7 +43,7 @@ import pretty.pprust;
import util.typestate_ann.ts_ann;
-type ty_table = hashmap[ast.def_id, @ty.t];
+type ty_table = hashmap[ast.def_id, ty.t];
tag any_item {
any_item_rust(@ast.item);
@@ -52,7 +52,7 @@ tag any_item {
type ty_item_table = hashmap[ast.def_id,any_item];
-type unify_cache_entry = tup(@ty.t,@ty.t,vec[mutable @ty.t]);
+type unify_cache_entry = tup(ty.t,ty.t,vec[mutable ty.t]);
type unify_cache = hashmap[unify_cache_entry,ty.Unify.result];
type crate_ctxt = rec(session.session sess,
@@ -66,7 +66,7 @@ type crate_ctxt = rec(session.session sess,
mutable uint cache_misses,
@ty.type_store tystore);
-type fn_ctxt = rec(@ty.t ret_ty,
+type fn_ctxt = rec(ty.t ret_ty,
@ty_table locals,
@crate_ctxt ccx);
@@ -76,18 +76,18 @@ type ty_getter = fn(ast.def_id) -> ty.ty_param_count_and_ty;
// Substitutes the user's explicit types for the parameters in a path
// expression.
fn substitute_ty_params(&@crate_ctxt ccx,
- @ty.t typ,
+ ty.t typ,
uint ty_param_count,
- vec[@ty.t] supplied,
- &span sp) -> @ty.t {
- fn substituter(@crate_ctxt ccx, vec[@ty.t] supplied, @ty.t typ) -> @ty.t {
+ vec[ty.t] supplied,
+ &span sp) -> ty.t {
+ fn substituter(@crate_ctxt ccx, vec[ty.t] supplied, ty.t typ) -> ty.t {
alt (struct(typ)) {
case (ty.ty_bound_param(?pid)) { ret supplied.(pid); }
case (_) { ret typ; }
}
}
- auto supplied_len = _vec.len[@ty.t](supplied);
+ auto supplied_len = _vec.len[ty.t](supplied);
if (ty_param_count != supplied_len) {
ccx.sess.span_err(sp, "expected " +
_uint.to_str(ty_param_count, 10u) +
@@ -112,8 +112,8 @@ fn ty_param_count_and_ty_for_def(@fn_ctxt fcx, &ast.def defn)
case (ast.def_local(?id)) {
auto t;
alt (fcx.locals.find(id)) {
- case (some[@ty.t](?t1)) { t = t1; }
- case (none[@ty.t]) { t = ty.mk_local(fcx.ccx.tystore, id); }
+ case (some[ty.t](?t1)) { t = t1; }
+ case (none[ty.t]) { t = ty.mk_local(fcx.ccx.tystore, id); }
}
ret tup(0u, t);
}
@@ -175,13 +175,13 @@ fn instantiate_path(@fn_ctxt fcx, &ast.path pth, &ty_param_count_and_ty tpt,
auto ty_substs_opt;
auto ty_substs_len = _vec.len[@ast.ty](pth.node.types);
if (ty_substs_len > 0u) {
- let vec[@ty.t] ty_substs = vec();
+ let vec[ty.t] ty_substs = vec();
auto i = 0u;
while (i < ty_substs_len) {
ty_substs += vec(ast_ty_to_ty_crate(fcx.ccx, pth.node.types.(i)));
i += 1u;
}
- ty_substs_opt = some[vec[@ty.t]](ty_substs);
+ ty_substs_opt = some[vec[ty.t]](ty_substs);
if (ty_param_count == 0u) {
fcx.ccx.sess.span_err(sp, "this item does not take type " +
@@ -190,13 +190,13 @@ fn instantiate_path(@fn_ctxt fcx, &ast.path pth, &ty_param_count_and_ty tpt,
}
} else {
// We will acquire the type parameters through unification.
- let vec[@ty.t] ty_substs = vec();
+ let vec[ty.t] ty_substs = vec();
auto i = 0u;
while (i < ty_param_count) {
ty_substs += vec(next_ty_var(fcx.ccx));
i += 1u;
}
- ty_substs_opt = some[vec[@ty.t]](ty_substs);
+ ty_substs_opt = some[vec[ty.t]](ty_substs);
}
ret ast.ann_type(t, ty_substs_opt, none[@ts_ann]);
@@ -207,11 +207,11 @@ fn instantiate_path(@fn_ctxt fcx, &ast.path pth, &ty_param_count_and_ty tpt,
// corresponding to a definition ID.
fn ast_ty_to_ty(@ty.type_store tystore,
ty_getter getter,
- &@ast.ty ast_ty) -> @ty.t {
+ &@ast.ty ast_ty) -> ty.t {
fn ast_arg_to_arg(@ty.type_store tystore,
ty_getter getter,
&rec(ast.mode mode, @ast.ty ty) arg)
- -> rec(ast.mode mode, @ty.t ty) {
+ -> rec(ast.mode mode, ty.t ty) {
ret rec(mode=arg.mode, ty=ast_ty_to_ty(tystore, getter, arg.ty));
}
@@ -224,7 +224,7 @@ fn ast_ty_to_ty(@ty.type_store tystore,
fn instantiate(@ty.type_store tystore,
ty_getter getter,
ast.def_id id,
- vec[@ast.ty] args) -> @ty.t {
+ vec[@ast.ty] args) -> ty.t {
// TODO: maybe record cname chains so we can do
// "foo = int" like OCaml?
auto params_opt_and_ty = getter(id);
@@ -238,7 +238,7 @@ fn ast_ty_to_ty(@ty.type_store tystore,
// TODO: Make sure the number of supplied bindings matches the number
// of type parameters in the typedef. Emit a friendly error otherwise.
auto bound_ty = bind_params_in_type(tystore, params_opt_and_ty._1);
- let vec[@ty.t] param_bindings = vec();
+ let vec[ty.t] param_bindings = vec();
for (@ast.ty ast_ty in args) {
param_bindings += vec(ast_ty_to_ty(tystore, getter, ast_ty));
}
@@ -340,7 +340,7 @@ fn ast_ty_to_ty(@ty.type_store tystore,
// A convenience function to use a crate_ctxt to resolve names for
// ast_ty_to_ty.
-fn ast_ty_to_ty_crate(@crate_ctxt ccx, &@ast.ty ast_ty) -> @ty.t {
+fn ast_ty_to_ty_crate(@crate_ctxt ccx, &@ast.ty ast_ty) -> ty.t {
fn getter(@crate_ctxt ccx, ast.def_id id) -> ty.ty_param_count_and_ty {
ret ty.lookup_item_type(ccx.sess, ccx.tystore, ccx.type_cache, id);
}
@@ -368,7 +368,7 @@ mod Collect {
type env = rec(@ctxt cx, ast.native_abi abi);
fn ty_of_fn_decl(@ctxt cx,
- fn(&@ast.ty ast_ty) -> @ty.t convert,
+ fn(&@ast.ty ast_ty) -> ty.t convert,
fn(&ast.arg a) -> arg ty_of_arg,
&ast.fn_decl decl,
ast.proto proto,
@@ -384,7 +384,7 @@ mod Collect {
}
fn ty_of_native_fn_decl(@ctxt cx,
- fn(&@ast.ty ast_ty) -> @ty.t convert,
+ fn(&@ast.ty ast_ty) -> ty.t convert,
fn(&ast.arg a) -> arg ty_of_arg,
&ast.fn_decl decl,
ast.native_abi abi,
@@ -510,7 +510,7 @@ mod Collect {
case (ast.item_tag(_, _, ?tps, ?def_id, _)) {
// Create a new generic polytype.
- let vec[@ty.t] subtys = vec();
+ let vec[ty.t] subtys = vec();
auto i = 0u;
for (ast.ty_param tp in tps) {
@@ -563,7 +563,7 @@ mod Collect {
let vec[ast.variant] result = vec();
// Create a set of parameter types shared among all the variants.
- let vec[@ty.t] ty_param_tys = vec();
+ let vec[ty.t] ty_param_tys = vec();
auto i = 0u;
for (ast.ty_param tp in ty_params) {
ty_param_tys += vec(ty.mk_param(cx.tystore, i));
@@ -686,7 +686,7 @@ mod Collect {
ret @fold.respan[ast.native_item_](sp, item);
}
- fn get_ctor_obj_methods(@ty.t t) -> vec[method] {
+ fn get_ctor_obj_methods(ty.t t) -> vec[method] {
alt (struct(t)) {
case (ty.ty_fn(_,_,?tobj)) {
alt (struct(tobj)) {
@@ -735,7 +735,7 @@ mod Collect {
}
auto g = bind getter(e.cx, _);
for (ast.obj_field fld in ob.fields) {
- let @ty.t fty = ast_ty_to_ty(e.cx.tystore, g, fld.ty);
+ let ty.t fty = ast_ty_to_ty(e.cx.tystore, g, fld.ty);
let ast.obj_field f = rec(ann=triv_ann(fty)
with fld
);
@@ -746,7 +746,7 @@ mod Collect {
alt (ob.dtor) {
case (some[@ast.method](?d)) {
let vec[arg] inputs = vec();
- let @ty.t output = ty.mk_nil(e.cx.tystore);
+ let ty.t output = ty.mk_nil(e.cx.tystore);
auto dtor_tfn = ty.mk_fn(e.cx.tystore, ast.proto_fn, inputs,
output);
auto d_ = rec(ann=triv_ann(dtor_tfn) with d.node);
@@ -780,7 +780,7 @@ mod Collect {
ty_params);
auto typ = e.cx.type_cache.get(id)._1;
auto item = ast.item_tag(i, variants_t, ty_params, id,
- ast.ann_type(typ, none[vec[@ty.t]],
+ ast.ann_type(typ, none[vec[ty.t]],
none[@ts_ann]));
ret @fold.respan[ast.item_](sp, item);
}
@@ -830,16 +830,16 @@ mod Collect {
// Type unification
mod Unify {
- fn simple(@fn_ctxt fcx, @ty.t expected, @ty.t actual) -> ty.Unify.result {
+ fn simple(@fn_ctxt fcx, ty.t expected, ty.t actual) -> ty.Unify.result {
// FIXME: horrid botch
- let vec[mutable @ty.t] param_substs =
+ let vec[mutable ty.t] param_substs =
vec(mutable ty.mk_nil(fcx.ccx.tystore));
- _vec.pop[mutable @ty.t](param_substs);
+ _vec.pop[mutable ty.t](param_substs);
ret with_params(fcx, expected, actual, param_substs);
}
- fn with_params(@fn_ctxt fcx, @ty.t expected, @ty.t actual,
- vec[mutable @ty.t] param_substs) -> ty.Unify.result {
+ fn with_params(@fn_ctxt fcx, ty.t expected, ty.t actual,
+ vec[mutable ty.t] param_substs) -> ty.Unify.result {
auto cache_key = tup(expected, actual, param_substs);
if (fcx.ccx.unify_cache.contains_key(cache_key)) {
fcx.ccx.cache_hits += 1u;
@@ -848,25 +848,25 @@ mod Unify {
fcx.ccx.cache_misses += 1u;
- obj unify_handler(@fn_ctxt fcx, vec[mutable @ty.t] param_substs) {
- fn resolve_local(ast.def_id id) -> option.t[@ty.t] {
+ obj unify_handler(@fn_ctxt fcx, vec[mutable ty.t] param_substs) {
+ fn resolve_local(ast.def_id id) -> option.t[ty.t] {
alt (fcx.locals.find(id)) {
- case (none[@ty.t]) { ret none[@ty.t]; }
- case (some[@ty.t](?existing_type)) {
+ case (none[ty.t]) { ret none[ty.t]; }
+ case (some[ty.t](?existing_type)) {
if (ty.type_contains_vars(existing_type)) {
// Not fully resolved yet. The writeback phase
// will mop up.
- ret none[@ty.t];
+ ret none[ty.t];
}
- ret some[@ty.t](existing_type);
+ ret some[ty.t](existing_type);
}
}
}
- fn record_local(ast.def_id id, @ty.t new_type) {
+ fn record_local(ast.def_id id, ty.t new_type) {
auto unified_type;
alt (fcx.locals.find(id)) {
- case (none[@ty.t]) { unified_type = new_type; }
- case (some[@ty.t](?old_type)) {
+ case (none[ty.t]) { unified_type = new_type; }
+ case (some[ty.t](?old_type)) {
alt (with_params(fcx, old_type, new_type,
param_substs)) {
case (ures_ok(?ut)) { unified_type = ut; }
@@ -876,8 +876,8 @@ mod Unify {
}
// TODO: "freeze"
- let vec[@ty.t] param_substs_1 = vec();
- for (@ty.t subst in param_substs) {
+ let vec[ty.t] param_substs_1 = vec();
+ for (ty.t subst in param_substs) {
param_substs_1 += vec(subst);
}
@@ -886,7 +886,7 @@ mod Unify {
unified_type);
fcx.locals.insert(id, unified_type);
}
- fn record_param(uint index, @ty.t binding) -> ty.Unify.result {
+ fn record_param(uint index, ty.t binding) -> ty.Unify.result {
// Unify with the appropriate type in the parameter
// substitution list.
auto old_subst = param_substs.(index);
@@ -921,7 +921,7 @@ tag autoderef_kind {
NO_AUTODEREF;
}
-fn strip_boxes(@ty.t t) -> @ty.t {
+fn strip_boxes(ty.t t) -> ty.t {
auto t1 = t;
while (true) {
alt (struct(t1)) {
@@ -932,7 +932,7 @@ fn strip_boxes(@ty.t t) -> @ty.t {
fail;
}
-fn add_boxes(@crate_ctxt ccx, uint n, @ty.t t) -> @ty.t {
+fn add_boxes(@crate_ctxt ccx, uint n, ty.t t) -> ty.t {
auto t1 = t;
while (n != 0u) {
t1 = ty.mk_imm_box(ccx.tystore, t1);
@@ -942,7 +942,7 @@ fn add_boxes(@crate_ctxt ccx, uint n, @ty.t t) -> @ty.t {
}
-fn count_boxes(@ty.t t) -> uint {
+fn count_boxes(ty.t t) -> uint {
auto n = 0u;
auto t1 = t;
while (true) {
@@ -958,25 +958,25 @@ fn count_boxes(@ty.t t) -> uint {
// Demands - procedures that require that two types unify and emit an error
// message if they don't.
-type ty_param_substs_and_ty = tup(vec[@ty.t], @ty.t);
+type ty_param_substs_and_ty = tup(vec[ty.t], ty.t);
mod Demand {
- fn simple(@fn_ctxt fcx, &span sp, @ty.t expected, @ty.t actual) -> @ty.t {
- let vec[@ty.t] tps = vec();
+ fn simple(@fn_ctxt fcx, &span sp, ty.t expected, ty.t actual) -> ty.t {
+ let vec[ty.t] tps = vec();
ret full(fcx, sp, expected, actual, tps, NO_AUTODEREF)._1;
}
- fn autoderef(@fn_ctxt fcx, &span sp, @ty.t expected, @ty.t actual,
- autoderef_kind adk) -> @ty.t {
- let vec[@ty.t] tps = vec();
+ fn autoderef(@fn_ctxt fcx, &span sp, ty.t expected, ty.t actual,
+ autoderef_kind adk) -> ty.t {
+ let vec[ty.t] tps = vec();
ret full(fcx, sp, expected, actual, tps, adk)._1;
}
// Requires that the two types unify, and prints an error message if they
// don't. Returns the unified type and the type parameter substitutions.
- fn full(@fn_ctxt fcx, &span sp, @ty.t expected, @ty.t actual,
- vec[@ty.t] ty_param_substs_0, autoderef_kind adk)
+ fn full(@fn_ctxt fcx, &span sp, ty.t expected, ty.t actual,
+ vec[ty.t] ty_param_substs_0, autoderef_kind adk)
-> ty_param_substs_and_ty {
auto expected_1 = expected;
@@ -989,18 +989,18 @@ mod Demand {
implicit_boxes = count_boxes(actual);
}
- let vec[mutable @ty.t] ty_param_substs =
+ let vec[mutable ty.t] ty_param_substs =
vec(mutable ty.mk_nil(fcx.ccx.tystore));
- _vec.pop[mutable @ty.t](ty_param_substs); // FIXME: horrid botch
- for (@ty.t ty_param_subst in ty_param_substs_0) {
+ _vec.pop[mutable ty.t](ty_param_substs); // FIXME: horrid botch
+ for (ty.t ty_param_subst in ty_param_substs_0) {
ty_param_substs += vec(mutable ty_param_subst);
}
alt (Unify.with_params(fcx, expected_1, actual_1, ty_param_substs)) {
case (ures_ok(?t)) {
// TODO: Use "freeze", when we have it.
- let vec[@ty.t] result_ty_param_substs = vec();
- for (mutable @ty.t ty_param_subst in ty_param_substs) {
+ let vec[ty.t] result_ty_param_substs = vec();
+ for (mutable ty.t ty_param_subst in ty_param_substs) {
result_ty_param_substs += vec(ty_param_subst);
}
@@ -1024,7 +1024,7 @@ mod Demand {
// Returns true if the two types unify and false if they don't.
-fn are_compatible(&@fn_ctxt fcx, @ty.t expected, @ty.t actual) -> bool {
+fn are_compatible(&@fn_ctxt fcx, ty.t expected, ty.t actual) -> bool {
alt (Unify.simple(fcx, expected, actual)) {
case (ures_ok(_)) { ret true; }
case (ures_err(_, _, _)) { ret false; }
@@ -1033,10 +1033,10 @@ fn are_compatible(&@fn_ctxt fcx, @ty.t expected, @ty.t actual) -> bool {
// Returns the types of the arguments to a tag variant.
fn variant_arg_types(@crate_ctxt ccx, &span sp, ast.def_id vid,
- vec[@ty.t] tag_ty_params) -> vec[@ty.t] {
- auto ty_param_count = _vec.len[@ty.t](tag_ty_params);
+ vec[ty.t] tag_ty_params) -> vec[ty.t] {
+ auto ty_param_count = _vec.len[ty.t](tag_ty_params);
- let vec[@ty.t] result = vec();
+ let vec[ty.t] result = vec();
auto tpt = ty.lookup_item_type(ccx.sess, ccx.tystore, ccx.type_cache,
vid);
@@ -1081,20 +1081,20 @@ mod Pushdown {
//
// TODO: enforce this via a predicate.
- fn pushdown_pat(&@fn_ctxt fcx, @ty.t expected, @ast.pat pat) -> @ast.pat {
+ fn pushdown_pat(&@fn_ctxt fcx, ty.t expected, @ast.pat pat) -> @ast.pat {
auto p_1;
alt (pat.node) {
case (ast.pat_wild(?ann)) {
auto t = Demand.simple(fcx, pat.span, expected,
ann_to_type(ann));
- p_1 = ast.pat_wild(ast.ann_type(t, none[vec[@ty.t]],
+ p_1 = ast.pat_wild(ast.ann_type(t, none[vec[ty.t]],
none[@ts_ann]));
}
case (ast.pat_lit(?lit, ?ann)) {
auto t = Demand.simple(fcx, pat.span, expected,
ann_to_type(ann));
- p_1 = ast.pat_lit(lit, ast.ann_type(t, none[vec[@ty.t]],
+ p_1 = ast.pat_lit(lit, ast.ann_type(t, none[vec[ty.t]],
none[@ts_ann]));
}
case (ast.pat_bind(?id, ?did, ?ann)) {
@@ -1102,7 +1102,7 @@ mod Pushdown {
ann_to_type(ann));
fcx.locals.insert(did, t);
p_1 = ast.pat_bind(id, did, ast.ann_type(t,
- none[vec[@ty.t]],
+ none[vec[ty.t]],
none[@ts_ann]));
}
case (ast.pat_tag(?id, ?subpats, ?vdef_opt, ?ann)) {
@@ -1143,12 +1143,12 @@ mod Pushdown {
// TODO: enforce this via a predicate.
// TODO: This function is incomplete.
- fn pushdown_expr(&@fn_ctxt fcx, @ty.t expected, @ast.expr e)
+ fn pushdown_expr(&@fn_ctxt fcx, ty.t expected, @ast.expr e)
-> @ast.expr {
be pushdown_expr_full(fcx, expected, e, NO_AUTODEREF);
}
- fn pushdown_expr_full(&@fn_ctxt fcx, @ty.t expected, @ast.expr e,
+ fn pushdown_expr_full(&@fn_ctxt fcx, ty.t expected, @ast.expr e,
autoderef_kind adk) -> @ast.expr {
auto e_1;
@@ -1374,11 +1374,11 @@ mod Pushdown {
}
case (ast.ann_type(_, ?tps_opt, _)) {
alt (tps_opt) {
- case (none[vec[@ty.t]]) {
- ty_params_opt = none[vec[@ty.t]];
+ case (none[vec[ty.t]]) {
+ ty_params_opt = none[vec[ty.t]];
}
- case (some[vec[@ty.t]](?tps)) {
- ty_params_opt = some[vec[@ty.t]](tps);
+ case (some[vec[ty.t]](?tps)) {
+ ty_params_opt = some[vec[ty.t]](tps);
}
}
}
@@ -1472,7 +1472,7 @@ mod Pushdown {
}
// Push-down over typed blocks.
- fn pushdown_block(&@fn_ctxt fcx, @ty.t expected, &ast.block bloc)
+ fn pushdown_block(&@fn_ctxt fcx, ty.t expected, &ast.block bloc)
-> ast.block {
alt (bloc.node.expr) {
case (some[@ast.expr](?e_0)) {
@@ -1514,7 +1514,7 @@ fn writeback_local(&option.t[@fn_ctxt] env, &span sp, @ast.local local)
fn resolve_local_types_in_annotation(&option.t[@fn_ctxt] env, ast.ann ann)
-> ast.ann {
- fn resolver(@fn_ctxt fcx, @ty.t typ) -> @ty.t {
+ fn resolver(@fn_ctxt fcx, ty.t typ) -> ty.t {
alt (struct(typ)) {
case (ty.ty_local(?lid)) { ret fcx.locals.get(lid); }
case (_) { ret typ; }
@@ -1563,7 +1563,7 @@ fn resolve_local_types_in_block(&@fn_ctxt fcx, &ast.block block)
// AST fragment checking
-fn check_lit(@crate_ctxt ccx, @ast.lit lit) -> @ty.t {
+fn check_lit(@crate_ctxt ccx, @ast.lit lit) -> ty.t {
alt (lit.node) {
case (ast.lit_str(_)) { ret ty.mk_str(ccx.tystore); }
case (ast.lit_char(_)) { ret ty.mk_char(ccx.tystore); }
@@ -2218,7 +2218,7 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
case (ast.expr_self_method(?id, _)) {
auto t = ty.mk_nil(fcx.ccx.tystore);
- let @ty.t this_obj_ty;
+ let ty.t this_obj_ty;
// Grab the type of the current object
auto this_obj_id = fcx.ccx.this_obj;
@@ -2233,7 +2233,7 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
// Grab this method's type out of the current object type
- // this_obj_ty is an @ty.t
+ // this_obj_ty is an ty.t
alt (struct(this_obj_ty)) {
case (ty.ty_obj(?methods)) {
for (ty.method method in methods) {
@@ -2302,7 +2302,7 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
case (ast.expr_vec(?args, ?mut, _)) {
let vec[@ast.expr] args_1 = vec();
- let @ty.t t;
+ let ty.t t;
if (_vec.len[@ast.expr](args) == 0u) {
t = next_ty_var(fcx.ccx);
} else {
@@ -2544,7 +2544,7 @@ fn check_expr(&@fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
}
}
-fn next_ty_var(@crate_ctxt ccx) -> @ty.t {
+fn next_ty_var(@crate_ctxt ccx) -> ty.t {
auto t = ty.mk_var(ccx.tystore, ccx.next_var_id);
ccx.next_var_id += 1;
ret t;
@@ -2667,7 +2667,7 @@ fn check_const(&@crate_ctxt ccx, &span sp, ast.ident ident, @ast.ty t,
// for checking the initializer expression.
auto rty = ann_to_type(ann);
let @fn_ctxt fcx = @rec(ret_ty = rty,
- locals = @common.new_def_hash[@ty.t](),
+ locals = @common.new_def_hash[ty.t](),
ccx = ccx);
auto e_ = check_expr(fcx, e);
// FIXME: necessary? Correct sequence?
@@ -2678,7 +2678,7 @@ fn check_const(&@crate_ctxt ccx, &span sp, ast.ident ident, @ast.ty t,
fn check_fn(&@crate_ctxt ccx, &ast.fn_decl decl, ast.proto proto,
&ast.block body) -> ast._fn {
- auto local_ty_table = @common.new_def_hash[@ty.t]();
+ auto local_ty_table = @common.new_def_hash[ty.t]();
// FIXME: duplicate work: the item annotation already has the arg types
// and return type translated to typeck.ty values. We don't need do to it
@@ -2752,7 +2752,7 @@ fn hash_unify_cache_entry(&unify_cache_entry uce) -> uint {
h += h << 5u + ty.hash_ty(uce._1);
auto i = 0u;
- auto tys_len = _vec.len[mutable @ty.t](uce._2);
+ auto tys_len = _vec.len[mutable ty.t](uce._2);
while (i < tys_len) {
h += h << 5u + ty.hash_ty(uce._2.(i));
i += 1u;
@@ -2765,8 +2765,8 @@ fn eq_unify_cache_entry(&unify_cache_entry a, &unify_cache_entry b) -> bool {
if (!ty.eq_ty(a._0, b._0) || !ty.eq_ty(a._1, b._1)) { ret false; }
auto i = 0u;
- auto tys_len = _vec.len[mutable @ty.t](a._2);
- if (_vec.len[mutable @ty.t](b._2) != tys_len) { ret false; }
+ auto tys_len = _vec.len[mutable ty.t](a._2);
+ if (_vec.len[mutable ty.t](b._2) != tys_len) { ret false; }
while (i < tys_len) {
if (!ty.eq_ty(a._2.(i), b._2.(i))) { ret false; }
diff --git a/src/comp/util/common.rs b/src/comp/util/common.rs
index afec418c..0d0ca05d 100644
--- a/src/comp/util/common.rs
+++ b/src/comp/util/common.rs
@@ -112,7 +112,7 @@ fn field_exprs(vec[ast.field] fields) -> vec [@ast.expr] {
fn plain_ann(@middle.ty.type_store tystore) -> ast.ann {
ret ast.ann_type(middle.ty.mk_nil(tystore),
- none[vec[@middle.ty.t]], none[@ts_ann]);
+ none[vec[middle.ty.t]], none[@ts_ann]);
}
fn log_expr(&ast.expr e) -> () {