Skip to content

Commit c7473c8

Browse files
committed
rustc: Switch @ty.t to ty.t so that we can change it to a uint
1 parent fac8cc3 commit c7473c8

File tree

7 files changed

+424
-423
lines changed

7 files changed

+424
-423
lines changed

src/comp/front/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ type ty_param = ident;
2222
// Annotations added during successive passes.
2323
tag ann {
2424
ann_none;
25-
ann_type(@middle.ty.t,
26-
option.t[vec[@middle.ty.t]], /* ty param substs */
25+
ann_type(middle.ty.t,
26+
option.t[vec[middle.ty.t]], /* ty param substs */
2727
option.t[@ts_ann]); /* pre- and postcondition for typestate */
2828
}
2929

src/comp/front/creader.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn next(@pstate st) -> u8 {
6363
ret ch as u8;
6464
}
6565

66-
fn parse_ty_str(str rep, str_def sd, @ty.type_store tystore) -> @ty.t {
66+
fn parse_ty_str(str rep, str_def sd, @ty.type_store tystore) -> ty.t {
6767
auto len = _str.byte_len(rep);
6868
auto st = @rec(rep=rep, mutable pos=0u, len=len, tystore=tystore);
6969
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 {
7575
ret result;
7676
}
7777

78-
fn parse_ty(@pstate st, str_def sd) -> @ty.t {
78+
fn parse_ty(@pstate st, str_def sd) -> ty.t {
7979
alt (next(st) as char) {
8080
case ('n') { ret ty.mk_nil(st.tystore); }
8181
case ('b') { ret ty.mk_bool(st.tystore); }
@@ -101,7 +101,7 @@ fn parse_ty(@pstate st, str_def sd) -> @ty.t {
101101
case ('t') {
102102
check(next(st) as char == '[');
103103
auto def = parse_def(st, sd);
104-
let vec[@ty.t] params = vec();
104+
let vec[ty.t] params = vec();
105105
while (peek(st) as char != ']') {
106106
params += vec(parse_ty(st, sd));
107107
}
@@ -213,7 +213,7 @@ fn parse_int(@pstate st) -> int {
213213
ret n;
214214
}
215215

216-
fn parse_ty_fn(@pstate st, str_def sd) -> tup(vec[ty.arg], @ty.t) {
216+
fn parse_ty_fn(@pstate st, str_def sd) -> tup(vec[ty.arg], ty.t) {
217217
check(next(st) as char == '[');
218218
let vec[ty.arg] inputs = vec();
219219
while (peek(st) as char != ']') {
@@ -331,7 +331,7 @@ fn variant_tag_id(&ebml.doc d) -> ast.def_id {
331331
ret parse_def_id(ebml.doc_data(tagdoc));
332332
}
333333

334-
fn item_type(&ebml.doc item, int this_cnum, @ty.type_store tystore) -> @ty.t {
334+
fn item_type(&ebml.doc item, int this_cnum, @ty.type_store tystore) -> ty.t {
335335
fn parse_external_def_id(int this_cnum, str s) -> ast.def_id {
336336
// FIXME: This is completely wrong when linking against a crate
337337
// that, in turn, links against another crate. We need a mapping
@@ -545,7 +545,7 @@ fn get_tag_variants(session.session sess,
545545
for (ast.def_id did in variant_ids) {
546546
auto item = find_item(did._1, items);
547547
auto ctor_ty = item_type(item, external_crate_id, tystore);
548-
let vec[@ty.t] arg_tys = vec();
548+
let vec[ty.t] arg_tys = vec();
549549
alt (ty.struct(ctor_ty)) {
550550
case (ty.ty_fn(_, ?args, _)) {
551551
for (ty.arg a in args) {

src/comp/middle/metadata.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const uint tag_index_table = 0x15u;
5252
// Callback to translate defs to strs or back.
5353
type def_str = fn(ast.def_id) -> str;
5454

55-
fn ty_str(@ty.t t, def_str ds) -> str {
55+
fn ty_str(ty.t t, def_str ds) -> str {
5656
ret sty_str(ty.struct(t), ds);
5757
}
5858

@@ -91,7 +91,7 @@ fn sty_str(ty.sty st, def_str ds) -> str {
9191
case (ty.ty_str) {ret "s";}
9292
case (ty.ty_tag(?def,?tys)) { // TODO restore def_id
9393
auto acc = "t[" + ds(def) + "|";
94-
for (@ty.t t in tys) {acc += ty_str(t, ds);}
94+
for (ty.t t in tys) {acc += ty_str(t, ds);}
9595
ret acc + "]";
9696
}
9797
case (ty.ty_box(?mt)) {ret "@" + mt_str(mt, ds);}
@@ -151,7 +151,7 @@ fn proto_str(ast.proto proto) -> str {
151151
}
152152
}
153153

154-
fn ty_fn_str(vec[ty.arg] args, @ty.t out, def_str ds) -> str {
154+
fn ty_fn_str(vec[ty.arg] args, ty.t out, def_str ds) -> str {
155155
auto acc = "[";
156156
for (ty.arg arg in args) {
157157
if (arg.mode == ast.alias) {acc += "&";}
@@ -327,7 +327,7 @@ fn encode_variant_id(&ebml.writer ebml_w, ast.def_id vid) {
327327
ebml.end_tag(ebml_w);
328328
}
329329

330-
fn encode_type(&ebml.writer ebml_w, @ty.t typ) {
330+
fn encode_type(&ebml.writer ebml_w, ty.t typ) {
331331
ebml.start_tag(ebml_w, tag_items_data_item_type);
332332
auto f = def_to_str;
333333
ebml_w.writer.write(_str.bytes(ty_str(typ, f)));

0 commit comments

Comments
 (0)