Skip to content

Commit 16da4e1

Browse files
committed
use node_id for indexing in ast_to_ty_cache
1 parent 0419e36 commit 16da4e1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ struct ctxt_ {
262262
needs_drop_cache: HashMap<t, bool>,
263263
needs_unwind_cleanup_cache: HashMap<t, bool>,
264264
mut tc_cache: LinearMap<uint, TypeContents>,
265-
ast_ty_to_ty_cache: HashMap<@ast::Ty, ast_ty_to_ty_cache_entry>,
265+
ast_ty_to_ty_cache: HashMap<node_id, ast_ty_to_ty_cache_entry>,
266266
enum_var_cache: HashMap<def_id, @~[VariantInfo]>,
267267
trait_method_cache: HashMap<def_id, @~[method]>,
268268
ty_param_bounds: HashMap<ast::node_id, param_bounds>,

src/librustc/middle/typeck/astconv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub fn ast_ty_to_ty<AC: AstConv, RS: region_scope Copy Durable>(
277277

278278
let tcx = self.tcx();
279279

280-
match tcx.ast_ty_to_ty_cache.find(&ast_ty) {
280+
match tcx.ast_ty_to_ty_cache.find(&ast_ty.id) {
281281
Some(ty::atttce_resolved(ty)) => return ty,
282282
Some(ty::atttce_unresolved) => {
283283
tcx.sess.span_fatal(ast_ty.span, ~"illegal recursive type; \
@@ -287,7 +287,7 @@ pub fn ast_ty_to_ty<AC: AstConv, RS: region_scope Copy Durable>(
287287
None => { /* go on */ }
288288
}
289289

290-
tcx.ast_ty_to_ty_cache.insert(ast_ty, ty::atttce_unresolved);
290+
tcx.ast_ty_to_ty_cache.insert(ast_ty.id, ty::atttce_unresolved);
291291
let typ = match /*bad*/copy ast_ty.node {
292292
ast::ty_nil => ty::mk_nil(tcx),
293293
ast::ty_bot => ty::mk_bot(tcx),
@@ -409,7 +409,7 @@ pub fn ast_ty_to_ty<AC: AstConv, RS: region_scope Copy Durable>(
409409
}
410410
};
411411

412-
tcx.ast_ty_to_ty_cache.insert(ast_ty, ty::atttce_resolved(typ));
412+
tcx.ast_ty_to_ty_cache.insert(ast_ty.id, ty::atttce_resolved(typ));
413413
return typ;
414414
}
415415

0 commit comments

Comments
 (0)