diff options
| author | Michael Sullivan <sully@msully.net> | 2012-06-12 10:29:17 -0700 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2012-06-12 10:58:00 -0700 |
| commit | d04ed0c4931f36f15e18f46b233d13572f4c9107 (patch) | |
| tree | b8b9348acc59547e3d556c669eb94fa8a1ecd833 | |
| parent | 07bba397c5b46c96cfb8de23c34b9bae47e07947 (diff) | |
| download | rust-d04ed0c4931f36f15e18f46b233d13572f4c9107.tar.gz rust-d04ed0c4931f36f15e18f46b233d13572f4c9107.zip | |
Reorder things in hash_type_structure to make more sense.
| -rw-r--r-- | src/rustc/middle/ty.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index bbbdafa6a7a..ca88ea927e2 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -2052,38 +2052,34 @@ fn hash_type_structure(st: sty) -> uint { ty_box(mt) { hash_subty(19u, mt.ty) } ty_evec(mt, _) { hash_subty(20u, mt.ty) } ty_vec(mt) { hash_subty(21u, mt.ty) } + ty_tup(ts) { hash_subtys(25u, ts) } ty_rec(fields) { let mut h = 26u; for fields.each {|f| h = hash_subty(h, f.mt.ty); } h } - ty_tup(ts) { hash_subtys(25u, ts) } ty_fn(f) { let mut h = 27u; for f.inputs.each {|a| h = hash_subty(h, a.ty); } hash_subty(h, f.output) } + ty_self { 28u } ty_var(v) { hash_uint(29u, v.to_uint()) } ty_var_integral(v) { hash_uint(30u, v.to_uint()) } ty_param(pid, did) { hash_def(hash_uint(31u, pid), did) } - ty_self { 28u } ty_type { 32u } ty_bot { 34u } ty_ptr(mt) { hash_subty(35u, mt.ty) } - ty_rptr(region, mt) { - let mut h = (46u << 2u) + hash_region(region); - hash_subty(h, mt.ty) - } - ty_res(did, sub, substs) { - let mut h = hash_subty(hash_def(18u, did), sub); - hash_substs(h, substs) - } ty_constr(t, cs) { let mut h = hash_subty(36u, t); for cs.each {|c| h = (h << 2u) + hash_type_constr(h, c); } h } ty_uniq(mt) { hash_subty(37u, mt.ty) } + ty_res(did, sub, substs) { + let mut h = hash_subty(hash_def(38u, did), sub); + hash_substs(h, substs) + } ty_iface(did, substs) { let mut h = hash_def(40u, did); hash_substs(h, substs) @@ -2096,6 +2092,10 @@ fn hash_type_structure(st: sty) -> uint { let mut h = hash_def(45u, did); hash_substs(h, substs) } + ty_rptr(region, mt) { + let mut h = (46u << 2u) + hash_region(region); + hash_subty(h, mt.ty) + } } } |
