Skip to content

Commit cc2ebbe

Browse files
committed
Pretty-print constrained types correctly
1 parent 09e21fe commit cc2ebbe

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/comp/syntax/print/pprust.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1718,8 +1718,13 @@ fn proto_to_str(p: &ast::proto) -> str {
17181718
}
17191719

17201720
fn ty_constr_to_str(c: &@ast::ty_constr) -> str {
1721+
fn ty_constr_path_to_str(p: &ast::path) -> str {
1722+
"*." + path_to_str(p)
1723+
}
1724+
17211725
ret path_to_str(c.node.path) +
1722-
constr_args_to_str::<ast::path>(path_to_str, c.node.args);
1726+
constr_args_to_str::<ast::path>(ty_constr_path_to_str,
1727+
c.node.args);
17231728
}
17241729

17251730

src/test/run-pass/constrained-type.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// xfail-pretty
21
// -*- rust -*-
32

43
tag list { cons(int, @list); nil; }

0 commit comments

Comments
 (0)