From aea537779e01359cf8da6944218362d44bfaee83 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 26 Jul 2011 14:06:02 +0200 Subject: Remove all uses of tuples from the compiler and stdlib --- src/comp/syntax/ast.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/comp/syntax/ast.rs') 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); + } } } -- cgit 1.4.1-3-g733a5