Move ppaux::ty_to_str to new record syntax

This commit is contained in:
Marijn Haverbeke 2011-08-02 11:42:29 +02:00
parent 8d8ff16dfe
commit 043d95a2bd
4 changed files with 5 additions and 5 deletions

View file

@ -65,7 +65,7 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> str {
m.output, m.cf, m.constrs) + ";";
}
fn field_to_str(cx: &ctxt, f: &field) -> str {
ret mt_to_str(cx, f.mt) + " " + f.ident;
ret f.ident + ": " + mt_to_str(cx, f.mt);
}
fn mt_to_str(cx: &ctxt, m: &mt) -> str {
let mstr;
@ -100,7 +100,7 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> str {
ty_rec(elems) {
let strs: str[] = ~[];
for fld: field in elems { strs += ~[field_to_str(cx, fld)]; }
s += "rec(" + str::connect_ivec(strs, ",") + ")";
s += "{" + str::connect_ivec(strs, ",") + "}";
}
ty_tag(id, tps) {
// The user should never see this if the cname is set properly!