From 043d95a2bdc6a344f1bfc7800b0ed719dbb6c7aa Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 2 Aug 2011 11:42:29 +0200 Subject: [PATCH] Move ppaux::ty_to_str to new record syntax --- src/comp/util/ppaux.rs | 4 ++-- src/test/compile-fail/binop-add-tup-assign.rs | 2 +- src/test/compile-fail/binop-add-tup.rs | 2 +- src/test/compile-fail/main-wrong-type.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/comp/util/ppaux.rs b/src/comp/util/ppaux.rs index fdc71f9357b2..93530b26f353 100644 --- a/src/comp/util/ppaux.rs +++ b/src/comp/util/ppaux.rs @@ -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! diff --git a/src/test/compile-fail/binop-add-tup-assign.rs b/src/test/compile-fail/binop-add-tup-assign.rs index fbd22745ccb1..4f3bc7a8ee96 100644 --- a/src/test/compile-fail/binop-add-tup-assign.rs +++ b/src/test/compile-fail/binop-add-tup-assign.rs @@ -1,4 +1,4 @@ // xfail-stage0 -// error-pattern:+ cannot be applied to type `rec(bool x)` +// error-pattern:+ cannot be applied to type `{x: bool}` fn main() { let x = {x: true}; x += {x: false}; } \ No newline at end of file diff --git a/src/test/compile-fail/binop-add-tup.rs b/src/test/compile-fail/binop-add-tup.rs index 313ec76d8be7..71a3be9f31bc 100644 --- a/src/test/compile-fail/binop-add-tup.rs +++ b/src/test/compile-fail/binop-add-tup.rs @@ -1,4 +1,4 @@ // xfail-stage0 -// error-pattern:+ cannot be applied to type `rec(bool x)` +// error-pattern:+ cannot be applied to type `{x: bool}` fn main() { let x = {x: true} + {x: false}; } \ No newline at end of file diff --git a/src/test/compile-fail/main-wrong-type.rs b/src/test/compile-fail/main-wrong-type.rs index 58b3b26a8c4a..babcdde2d308 100644 --- a/src/test/compile-fail/main-wrong-type.rs +++ b/src/test/compile-fail/main-wrong-type.rs @@ -1,3 +1,3 @@ // xfail-stage0 -// error-pattern:Wrong type in main function: found fn(rec(int x +// error-pattern:Wrong type in main function: found fn( fn main(foo: {x: int, y: int}) { } \ No newline at end of file