about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-01-13 11:05:40 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-01-14 18:14:16 -0800
commitdf7d376d257858debdc29c954c6d2fb3d9ef2334 (patch)
treed6cb6d4f5bb0f6ee16f5e3c2896c0cdf4ce6d0cb /src/libsyntax
parentbea67bde21d36df40c55b02cd8d8b28c0ec864b6 (diff)
downloadrust-df7d376d257858debdc29c954c6d2fb3d9ef2334.tar.gz
rust-df7d376d257858debdc29c954c6d2fb3d9ef2334.zip
Convert ast::def_id into a struct.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs5
-rw-r--r--src/libsyntax/ast_util.rs4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index f5fbb11655b..6c4e2b283a6 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -93,7 +93,10 @@ type node_id = int;
 
 #[auto_encode]
 #[auto_decode]
-type def_id = {crate: crate_num, node: node_id};
+struct def_id {
+    crate: crate_num,
+    node: node_id,
+}
 
 impl def_id : cmp::Eq {
     pure fn eq(&self, other: &def_id) -> bool {
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index d2012637b02..113556e3895 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -54,7 +54,9 @@ pure fn path_name_i(idents: &[ident], intr: @token::ident_interner) -> ~str {
 
 pure fn path_to_ident(p: @path) -> ident { vec::last(p.idents) }
 
-pure fn local_def(id: node_id) -> def_id { {crate: local_crate, node: id} }
+pure fn local_def(id: node_id) -> def_id {
+    ast::def_id { crate: local_crate, node: id }
+}
 
 pure fn is_local(did: ast::def_id) -> bool { did.crate == local_crate }