]> git.lizzy.rs Git - rust.git/commitdiff
fix hash function: + binds tighter than <<
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 7 Dec 2011 05:34:50 +0000 (21:34 -0800)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 7 Dec 2011 05:34:50 +0000 (21:34 -0800)
src/comp/syntax/ast_util.rs

index e9b89b59cd51acfde0326b2ea41f9e81ad1c566f..f39b5865c2515a225fbe6e5d2ee8f6251f2a3714 100644 (file)
@@ -193,7 +193,10 @@ fn is_constraint_arg(e: @expr) -> bool {
 
 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_ty(&&t: @ty) -> uint {
+    let res = (t.span.lo << 16u) + t.span.hi;
+    ret res;
+}
 
 fn hash_def_id(&&id: def_id) -> uint {
     id.crate as uint << 16u + (id.node as uint)