diff options
| author | Graydon Hoare <[email protected]> | 2011-04-27 13:36:39 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-04-27 13:36:39 -0700 |
| commit | 776255695a7a6a8a87c54c4db16fdbfb5d2bd42f (patch) | |
| tree | c256a340c4fcb5c11139f0e8dd983d850c5d05a8 /src | |
| parent | Cache sha1 values of types, use seq-based mangling for glue as it's private a... (diff) | |
| download | rust-776255695a7a6a8a87c54c4db16fdbfb5d2bd42f.tar.xz rust-776255695a7a6a8a87c54c4db16fdbfb5d2bd42f.zip | |
Use cnames when present in ty.ty_to_str.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/middle/ty.rs | 20 |
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)) { |