about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2015-01-14 20:03:17 -0500
committerJorge Aparicio <japaricious@gmail.com>2015-01-14 20:03:17 -0500
commit28b0d4029e3ae65505b19bf74379a8516b0e1fc9 (patch)
tree5330189c35f02eb906d95219e6acecd6914ca47d /src/libsyntax
parent86948adfdedb35051e55f41e865ee0ead6f53471 (diff)
downloadrust-28b0d4029e3ae65505b19bf74379a8516b0e1fc9.tar.gz
rust-28b0d4029e3ae65505b19bf74379a8516b0e1fc9.zip
use better span
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/deriving/hash.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libsyntax/ext/deriving/hash.rs b/src/libsyntax/ext/deriving/hash.rs
index 98b7fae0341..889a212a287 100644
--- a/src/libsyntax/ext/deriving/hash.rs
+++ b/src/libsyntax/ext/deriving/hash.rs
@@ -65,19 +65,19 @@ fn hash_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
         [ref state_expr] => state_expr,
         _ => cx.span_bug(trait_span, "incorrect number of arguments in `deriving(Hash)`")
     };
-    let hash_path = {
-        let strs = vec![
-            cx.ident_of("std"),
-            cx.ident_of("hash"),
-            cx.ident_of("Hash"),
-            cx.ident_of("hash"),
-        ];
-
-        cx.expr_path(cx.path_global(trait_span, strs))
-    };
     let call_hash = |&: span, thing_expr| {
+        let hash_path = {
+            let strs = vec![
+                cx.ident_of("std"),
+                cx.ident_of("hash"),
+                cx.ident_of("Hash"),
+                cx.ident_of("hash"),
+            ];
+
+            cx.expr_path(cx.path_global(span, strs))
+        };
         let ref_thing = cx.expr_addr_of(span, thing_expr);
-        let expr = cx.expr_call(span, hash_path.clone(), vec!(ref_thing, state_expr.clone()));
+        let expr = cx.expr_call(span, hash_path, vec!(ref_thing, state_expr.clone()));
         cx.stmt_expr(expr)
     };
     let mut stmts = Vec::new();