Skip to content

Commit 043d95a

Browse files
committed
Move ppaux::ty_to_str to new record syntax
1 parent 8d8ff16 commit 043d95a

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/comp/util/ppaux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> str {
6565
m.output, m.cf, m.constrs) + ";";
6666
}
6767
fn field_to_str(cx: &ctxt, f: &field) -> str {
68-
ret mt_to_str(cx, f.mt) + " " + f.ident;
68+
ret f.ident + ": " + mt_to_str(cx, f.mt);
6969
}
7070
fn mt_to_str(cx: &ctxt, m: &mt) -> str {
7171
let mstr;
@@ -100,7 +100,7 @@ fn ty_to_str(cx: &ctxt, typ: &t) -> str {
100100
ty_rec(elems) {
101101
let strs: str[] = ~[];
102102
for fld: field in elems { strs += ~[field_to_str(cx, fld)]; }
103-
s += "rec(" + str::connect_ivec(strs, ",") + ")";
103+
s += "{" + str::connect_ivec(strs, ",") + "}";
104104
}
105105
ty_tag(id, tps) {
106106
// The user should never see this if the cname is set properly!
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// xfail-stage0
2-
// error-pattern:+ cannot be applied to type `rec(bool x)`
2+
// error-pattern:+ cannot be applied to type `{x: bool}`
33

44
fn main() { let x = {x: true}; x += {x: false}; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// xfail-stage0
2-
// error-pattern:+ cannot be applied to type `rec(bool x)`
2+
// error-pattern:+ cannot be applied to type `{x: bool}`
33

44
fn main() { let x = {x: true} + {x: false}; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// xfail-stage0
2-
// error-pattern:Wrong type in main function: found fn(rec(int x
2+
// error-pattern:Wrong type in main function: found fn(
33
fn main(foo: {x: int, y: int}) { }

0 commit comments

Comments
 (0)