Remove all uses of tuples from the compiler and stdlib

This commit is contained in:
Marijn Haverbeke 2011-07-26 14:06:02 +02:00
parent e123366bff
commit aea537779e
45 changed files with 759 additions and 723 deletions

View file

@ -31,13 +31,13 @@ import print::pp::mk_printer;
type flag = hashmap[str, ()];
fn def_eq(&ast::def_id a, &ast::def_id b) -> bool {
ret a._0 == b._0 && a._1 == b._1;
ret a.crate == b.crate && a.node == b.node;
}
fn hash_def(&ast::def_id d) -> uint {
auto h = 5381u;
h = (h << 5u) + h ^ (d._0 as uint);
h = (h << 5u) + h ^ (d._1 as uint);
h = (h << 5u) + h ^ (d.crate as uint);
h = (h << 5u) + h ^ (d.node as uint);
ret h;
}

View file

@ -116,7 +116,7 @@ fn ty_to_str(&ctxt cx, &t typ) -> str {
case (ty_tag(?id, ?tps)) {
// The user should never see this if the cname is set properly!
s += "<tag#" + int::str(id._0) + ":" + int::str(id._1) + ">";
s += "<tag#" + int::str(id.crate) + ":" + int::str(id.node) + ">";
if (ivec::len[t](tps) > 0u) {
let str[] strs = ~[];
for (t typ in tps) { strs += ~[ty_to_str(cx, typ)]; }
@ -136,7 +136,8 @@ fn ty_to_str(&ctxt cx, &t typ) -> str {
s += "obj {\n\t" + str::connect_ivec(strs, "\n\t") + "\n}";
}
case (ty_res(?id, _, _)) {
s += "<resource#" + int::str(id._0) + ":" + int::str(id._1) + ">";
s += "<resource#" + int::str(id.node) + ":" +
int::str(id.crate) + ">";
}
case (ty_var(?v)) { s += "<T" + int::str(v) + ">"; }
case (ty_param(?id)) {