aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-04-27 13:36:39 -0700
committerGraydon Hoare <[email protected]>2011-04-27 13:36:39 -0700
commit776255695a7a6a8a87c54c4db16fdbfb5d2bd42f (patch)
treec256a340c4fcb5c11139f0e8dd983d850c5d05a8 /src/comp/middle
parentCache sha1 values of types, use seq-based mangling for glue as it's private a... (diff)
downloadrust-776255695a7a6a8a87c54c4db16fdbfb5d2bd42f.tar.xz
rust-776255695a7a6a8a87c54c4db16fdbfb5d2bd42f.zip
Use cnames when present in ty.ty_to_str.
Diffstat (limited to 'src/comp/middle')
-rw-r--r--src/comp/middle/ty.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index 24078767..f5cea365 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -544,6 +544,13 @@ fn ty_to_str(ctxt cx, &t typ) -> str {
ret mstr + ty_to_str(cx, m.ty);
}
+ alt (cname(cx, typ)) {
+ case (some[str](?cs)) {
+ ret cs;
+ }
+ case (_) { }
+ }
+
auto s = "";
alt (struct(cx, typ)) {
@@ -594,16 +601,9 @@ fn ty_to_str(ctxt cx, &t typ) -> str {
}
case (ty_obj(?meths)) {
- alt (cname(cx, typ)) {
- case (some[str](?cs)) {
- s += cs;
- }
- case (_) {
- auto f = bind method_to_str(cx, _);
- auto m = _vec.map[method,str](f, meths);
- s += "obj {\n\t" + _str.connect(m, "\n\t") + "\n}";
- }
- }
+ auto f = bind method_to_str(cx, _);
+ auto m = _vec.map[method,str](f, meths);
+ s += "obj {\n\t" + _str.connect(m, "\n\t") + "\n}";
}
case (ty_var(?v)) {