Skip to content

Commit 9774377

Browse files
committed
---
yaml --- r: 2923 b: refs/heads/master c: ba74c6c h: refs/heads/master i: 2921: 6da5f95 2919: fc39ab3 v: v3
1 parent a69b66c commit 9774377

File tree

6 files changed

+21
-1
lines changed

6 files changed

+21
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 18b63865ce35901d9beaf7ea94f4b1408defd7ad
2+
refs/heads/master: ba74c6cfdc2cb4e0e3374fee3af54e8b1f3564ac

trunk/src/comp/middle/metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ mod Encode {
174174
w.write_char(']');
175175
}
176176
case (ty::ty_box(?mt)) {w.write_char('@'); enc_mt(w, cx, mt); }
177+
case (ty::ty_ptr(?mt)) {w.write_char('*'); enc_mt(w, cx, mt); }
177178
case (ty::ty_vec(?mt)) {w.write_char('V'); enc_mt(w, cx, mt); }
178179
case (ty::ty_port(?t)) {w.write_char('P'); enc_ty(w, cx, t); }
179180
case (ty::ty_chan(?t)) {w.write_char('C'); enc_ty(w, cx, t); }

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,9 @@ fn type_of_inner(&@crate_ctxt cx, &span sp, &ty::t t) -> TypeRef {
882882
case (ty::ty_vec(?mt)) {
883883
llty = T_ptr(T_vec(type_of_inner(cx, sp, mt.ty)));
884884
}
885+
case (ty::ty_ptr(?mt)) {
886+
llty = T_ptr(type_of_inner(cx, sp, mt.ty));
887+
}
885888
case (ty::ty_port(?t)) {
886889
llty = T_ptr(T_port(type_of_inner(cx, sp, t)));
887890
}

trunk/src/comp/middle/ty.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ tag sty {
109109
ty_tag(ast::def_id, vec[t]);
110110
ty_box(mt);
111111
ty_vec(mt);
112+
ty_ptr(mt);
112113
ty_port(t);
113114
ty_chan(t);
114115
ty_task;
@@ -436,6 +437,10 @@ fn mk_box(&ctxt cx, &mt tm) -> t {
436437
ret gen_ty(cx, ty_box(tm));
437438
}
438439

440+
fn mk_ptr(&ctxt cx, &mt tm) -> t {
441+
ret gen_ty(cx, ty_ptr(tm));
442+
}
443+
439444
fn mk_imm_box(&ctxt cx, &t ty) -> t {
440445
ret mk_box(cx, rec(ty=ty, mut=ast::imm));
441446
}
@@ -1225,6 +1230,7 @@ fn hash_type_structure(&sty st) -> uint {
12251230
case (ty_type) { ret 32u; }
12261231
case (ty_native) { ret 33u; }
12271232
case (ty_bot) { ret 34u; }
1233+
case (ty_ptr(?mt)) { ret hash_subty(35u, mt.ty); }
12281234
}
12291235
}
12301236

@@ -1356,6 +1362,12 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
13561362
case (_) { ret false; }
13571363
}
13581364
}
1365+
case (ty_ptr(?mt_a)) {
1366+
alt (b) {
1367+
case (ty_ptr(?mt_b)) { ret equal_mt(mt_a, mt_b); }
1368+
case (_) { ret false; }
1369+
}
1370+
}
13591371
case (ty_port(?t_a)) {
13601372
alt (b) {
13611373
case (ty_port(?t_b)) { ret eq_ty(t_a, t_b); }

trunk/src/comp/middle/typeck.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
284284
case (ast::ty_vec(?mt)) {
285285
typ = ty::mk_vec(tcx, ast_mt_to_mt(tcx, getter, mt));
286286
}
287+
case (ast::ty_ptr(?mt)) {
288+
typ = ty::mk_ptr(tcx, ast_mt_to_mt(tcx, getter, mt));
289+
}
287290
case (ast::ty_task) { typ = ty::mk_task(tcx); }
288291
case (ast::ty_port(?t)) {
289292
typ = ty::mk_port(tcx, ast_ty_to_ty(tcx, getter, t));

trunk/src/comp/middle/walk.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ fn walk_ty(&ast_visitor v, @ast::ty t) {
156156
case (ast::ty_str) {}
157157
case (ast::ty_box(?mt)) { walk_ty(v, mt.ty); }
158158
case (ast::ty_vec(?mt)) { walk_ty(v, mt.ty); }
159+
case (ast::ty_ptr(?mt)) { walk_ty(v, mt.ty); }
159160
case (ast::ty_task) {}
160161
case (ast::ty_port(?t)) { walk_ty(v, t); }
161162
case (ast::ty_chan(?t)) { walk_ty(v, t); }

0 commit comments

Comments
 (0)