From 8b608125ac2d59cace17fc3f177d13e2a0021716 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 6 Dec 2011 21:34:50 -0800 Subject: [PATCH] fix hash function: + binds tighter than << --- src/comp/syntax/ast_util.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/comp/syntax/ast_util.rs b/src/comp/syntax/ast_util.rs index e9b89b59cd51..f39b5865c251 100644 --- a/src/comp/syntax/ast_util.rs +++ b/src/comp/syntax/ast_util.rs @@ -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)