aboutsummaryrefslogtreecommitdiff
path: root/src/comp/pretty
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-04-08 21:27:54 -0700
committerPatrick Walton <[email protected]>2011-04-14 11:24:25 -0700
commit65b75788517ad797c1ae86f9d0c550ec620c4dfc (patch)
tree31fed8460b11b6deea72485d60f606a4c4ab8327 /src/comp/pretty
parentrustc: Use union-find for variable substitution (diff)
downloadrust-65b75788517ad797c1ae86f9d0c550ec620c4dfc.tar.xz
rust-65b75788517ad797c1ae86f9d0c550ec620c4dfc.zip
rustc: Remove generalize_ty. Instead, maintain an explicit type parameter substitution list.
Diffstat (limited to 'src/comp/pretty')
-rw-r--r--src/comp/pretty/pprust.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/comp/pretty/pprust.rs b/src/comp/pretty/pprust.rs
index 6aee29d7..c4c50845 100644
--- a/src/comp/pretty/pprust.rs
+++ b/src/comp/pretty/pprust.rs
@@ -50,6 +50,15 @@ fn expr_to_str(&@ast.expr e) -> str {
ret writer.get_str();
}
+fn pat_to_str(&@ast.pat p) -> str {
+ auto writer = io.string_writer();
+ auto s = @rec(s=pp.mkstate(writer.get_writer(), 78u),
+ comments=option.none[vec[lexer.cmnt]],
+ mutable cur_cmnt=0u);
+ print_pat(s, p);
+ ret writer.get_str();
+}
+
impure fn hbox(ps s) {
pp.hbox(s.s, indent_unit);
}