Skip to content

Commit 17b28a3

Browse files
committed
---
yaml --- r: 2206 b: refs/heads/master c: 94e5ca4 h: refs/heads/master v: v3
1 parent dc707b9 commit 17b28a3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
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: e0eccaddb2bad87993505fffc523a47b68018e64
2+
refs/heads/master: 94e5ca4df862b1ff3e1fdc1c02828813050845d6

trunk/src/comp/middle/ty.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn gen_ty(@type_store tystore, &sty st) -> t {
120120
}
121121

122122
fn gen_ty_full(@type_store tystore, &sty st, option.t[str] cname) -> t {
123-
auto h = hash_type_structure(st);
123+
auto h = hash_type_info(st, cname);
124124
auto new_type = @rec(struct=st, cname=cname, hash=h);
125125

126126
// Is it interned?
@@ -888,6 +888,15 @@ fn hash_type_structure(&sty st) -> uint {
888888
}
889889
}
890890

891+
fn hash_type_info(&sty st, option.t[str] cname_opt) -> uint {
892+
auto h = hash_type_structure(st);
893+
alt (cname_opt) {
894+
case (none[str]) { /* no-op */ }
895+
case (some[str](?s)) { h += h << 5u + _str.hash(s); }
896+
}
897+
ret h;
898+
}
899+
891900
fn hash_ty(&t typ) -> uint { ret typ.hash; }
892901

893902

0 commit comments

Comments
 (0)