Skip to content

Commit f9d0cde

Browse files
committed
syntax: Remove one of the two def_id hashers
1 parent 4756556 commit f9d0cde

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

src/librustsyntax/ast_util.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,6 @@ fn new_def_hash<V: copy>() -> std::map::hashmap<ast::def_id, V> {
242242
ret std::map::hashmap::<ast::def_id, V>(hasher, eqer);
243243
}
244244

245-
fn hash_def_id(&&id: def_id) -> uint {
246-
(id.crate as uint << 16u) + (id.node as uint)
247-
}
248-
249-
fn eq_def_id(&&a: def_id, &&b: def_id) -> bool {
250-
a == b
251-
}
252-
253-
fn new_def_id_hash<T: copy>() -> std::map::hashmap<def_id, T> {
254-
std::map::hashmap(hash_def_id, eq_def_id)
255-
}
256-
257245
fn block_from_expr(e: @expr) -> blk {
258246
let blk_ = default_block([], option::some::<@expr>(e), e.id);
259247
ret {node: blk_, span: e.span};

src/rustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5489,12 +5489,12 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
54895489
mut main_fn: none::<ValueRef>,
54905490
link_meta: link_meta,
54915491
enum_sizes: ty::new_ty_hash(),
5492-
discrims: ast_util::new_def_id_hash::<ValueRef>(),
5492+
discrims: ast_util::new_def_hash::<ValueRef>(),
54935493
discrim_symbols: int_hash::<str>(),
54945494
tydescs: ty::new_ty_hash(),
54955495
external: ast_util::new_def_hash(),
54965496
monomorphized: map::hashmap(hash_mono_id, {|a, b| a == b}),
5497-
monomorphizing: ast_util::new_def_id_hash(),
5497+
monomorphizing: ast_util::new_def_hash(),
54985498
type_use_cache: ast_util::new_def_hash(),
54995499
vtables: map::hashmap(hash_mono_id, {|a, b| a == b}),
55005500
const_cstr_cache: map::str_hash(),

src/rustc/middle/trans/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ enum mono_param_id {
874874
}
875875
type mono_id = @{def: ast::def_id, params: [mono_param_id]};
876876
fn hash_mono_id(&&mi: mono_id) -> uint {
877-
let mut h = syntax::ast_util::hash_def_id(mi.def);
877+
let mut h = syntax::ast_util::hash_def(mi.def);
878878
for vec::each(mi.params) {|param|
879879
h = h * alt param {
880880
mono_precise(ty, vts) {

src/rustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ fn mk_ctxt(s: session::session, dm: resolve::def_map, amap: ast_map::map,
465465
region_map: middle::region::region_map) -> ctxt {
466466
let interner = map::hashmap({|&&k: intern_key|
467467
hash_type_structure(k.struct) +
468-
option::map_default(k.o_def_id, 0u, ast_util::hash_def_id)
468+
option::map_default(k.o_def_id, 0u, ast_util::hash_def)
469469
}, {|&&a, &&b| a == b});
470470
@{diag: s.diagnostic(),
471471
interner: interner,

0 commit comments

Comments
 (0)