Fix the problem with check-fast randomly failing
Trans has been assuming that tag node id's are unique across crates and they are not so, depending on which way the wind is blowing, it would choose to use a crate-local tag variant instead of the correct one from std. No test case since I can't come up with a reliable one that compiles in a reasonable amount of time.
This commit is contained in:
@@ -184,6 +184,18 @@ fn eq_ty(&&a: @ty, &&b: @ty) -> bool { ret std::box::ptr_eq(a, b); }
|
||||
|
||||
fn hash_ty(&&t: @ty) -> uint { ret t.span.lo << 16u + t.span.hi; }
|
||||
|
||||
fn hash_def_id(&&id: def_id) -> uint {
|
||||
id.crate as uint << 16u + (id.node as uint)
|
||||
}
|
||||
|
||||
fn eq_def_id(&&a: def_id, &&b: def_id) -> bool {
|
||||
a == b
|
||||
}
|
||||
|
||||
fn new_def_id_hash<@T>() -> std::map::hashmap<def_id, T> {
|
||||
std::map::mk_hashmap(hash_def_id, eq_def_id)
|
||||
}
|
||||
|
||||
fn block_from_expr(e: @expr) -> blk {
|
||||
let blk_ = default_block([], option::some::<@expr>(e), e.id);
|
||||
ret {node: blk_, span: e.span};
|
||||
|
||||
Reference in New Issue
Block a user