about summary refs log tree commit diff
path: root/src/comp/syntax/ast.rs
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-07-26 14:06:02 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-07-26 14:06:02 +0200
commitaea537779e01359cf8da6944218362d44bfaee83 (patch)
tree235edf688d4fb4928ff766c063dcac779548f34d /src/comp/syntax/ast.rs
parente123366bffa69ee3877335b9ca979b0cc301d07c (diff)
downloadrust-aea537779e01359cf8da6944218362d44bfaee83.tar.gz
rust-aea537779e01359cf8da6944218362d44bfaee83.zip
Remove all uses of tuples from the compiler and stdlib
Diffstat (limited to 'src/comp/syntax/ast.rs')
-rw-r--r--src/comp/syntax/ast.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs
index 3fa40c001c3..feba6b006c6 100644
--- a/src/comp/syntax/ast.rs
+++ b/src/comp/syntax/ast.rs
@@ -26,11 +26,11 @@ fn path_name_i(&ident[] idents) -> str { str::connect_ivec(idents, "::") }
 
 type crate_num = int;
 type node_id = int;
-type def_id = tup(crate_num, node_id);
+type def_id = rec(crate_num crate, node_id node);
 
 const crate_num local_crate = 0;
 fn local_def(node_id id) -> def_id {
-    ret tup(local_crate, id);
+    ret rec(crate=local_crate, node=id);
 }
 
 type ty_param = ident;
@@ -59,9 +59,11 @@ tag def {
     def_upvar(def_id, @def);
 }
 
-fn variant_def_ids(&def d) -> tup(def_id, def_id) {
+fn variant_def_ids(&def d) -> rec(def_id tg, def_id var) {
     alt (d) {
-        case (def_variant(?tag_id, ?var_id)) { ret tup(tag_id, var_id); }
+        case (def_variant(?tag_id, ?var_id)) {
+          ret rec(tg=tag_id, var=var_id);
+        }
     }
 }