Skip to content

Commit 11f00e8

Browse files
committed
---
yaml --- r: 3022 b: refs/heads/master c: 1377e9b h: refs/heads/master v: v3
1 parent e3cd260 commit 11f00e8

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
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: 5cd10d2fef8ffa68903b18726f19ac52a04725cc
2+
refs/heads/master: 1377e9b341a03915c48a564fb30e70022d04c78f

trunk/src/comp/front/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ fn is_constraint_arg(@expr e) -> bool {
504504
}
505505

506506
fn eq_ty(&@ty a, &@ty b) -> bool {
507-
ret a == b;
507+
ret std::box::ptr_eq(a,b);
508508
}
509509

510510
fn hash_ty(&@ty t) -> uint {

trunk/src/comp/middle/ty.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ type item_table = hashmap[ast::def_id,any_item];
6161

6262
type mt = rec(t ty, ast::mutability mut);
6363

64-
tag cached_ty {
65-
in_progress;
66-
done(t);
67-
}
68-
6964
// Contains information needed to resolve types and (in the future) look up
7065
// the types of AST nodes.
7166
type creader_cache = hashmap[tup(int,uint,uint),ty::t];
@@ -77,7 +72,7 @@ type ctxt = rec(@type_store ts,
7772
type_cache tcache,
7873
creader_cache rcache,
7974
hashmap[t,str] short_names_cache,
80-
hashmap[@ast::ty,cached_ty] ast_ty_to_ty_cache);
75+
hashmap[@ast::ty,option::t[t]] ast_ty_to_ty_cache);
8176
type ty_ctxt = ctxt; // Needed for disambiguation from unify::ctxt.
8277

8378
// Convert from method type to function type. Pretty easy; we just drop
@@ -253,7 +248,7 @@ fn mk_ctxt(session::session s, resolve::def_map dm) -> ctxt {
253248
short_names_cache =
254249
map::mk_hashmap[ty::t,str](ty::hash_ty, ty::eq_ty),
255250
ast_ty_to_ty_cache =
256-
map::mk_hashmap[@ast::ty,cached_ty](ast::hash_ty, ast::eq_ty));
251+
map::mk_hashmap[@ast::ty,option::t[t]](ast::hash_ty, ast::eq_ty));
257252

258253
populate_type_store(cx);
259254
ret cx;

trunk/src/comp/middle/typeck.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ fn ast_mode_to_mode(ast::mode mode) -> ty::mode {
228228
// corresponding to a definition ID:
229229
fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
230230
alt (tcx.ast_ty_to_ty_cache.find(ast_ty)) {
231-
case (some[ty::cached_ty](ty::done(?ty))) { ret ty; }
232-
case (some[ty::cached_ty](ty::in_progress)) {
231+
case (some[option::t[ty::t]](some[ty::t](?ty))) { ret ty; }
232+
case (some[option::t[ty::t]](none)) {
233233
tcx.sess.span_err(ast_ty.span, "illegal recursive type "
234234
+ "(insert a tag in the cycle, if this is desired)");
235235
}
236-
case (none[ty::cached_ty]) { } /* go on */
236+
case (none[option::t[ty::t]]) { } /* go on */
237237
}
238-
tcx.ast_ty_to_ty_cache.insert(ast_ty, ty::in_progress);
238+
tcx.ast_ty_to_ty_cache.insert(ast_ty, none[ty::t]);
239239

240240
fn ast_arg_to_arg(&ty::ctxt tcx,
241241
&ty_getter getter,
@@ -371,7 +371,7 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
371371
}
372372
}
373373

374-
tcx.ast_ty_to_ty_cache.insert(ast_ty, ty::done(typ));
374+
tcx.ast_ty_to_ty_cache.insert(ast_ty, some(typ));
375375
ret typ;
376376
}
377377

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// error-pattern:illegal recursive type
22
type t1 = rec(int foo, t1 foolish);
33

4-
fn main() {}
4+
fn main() {}

0 commit comments

Comments
 (0)