aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-04-26 13:07:51 -0700
committerPatrick Walton <[email protected]>2011-04-26 13:08:48 -0700
commitba3a4f6cc6a9a29c67b325d8a6a5d3b081f97773 (patch)
tree365c1db629f99386b95271a9c129301690329717 /src
parentstdlib: Add a silly ANSI color library (diff)
downloadrust-ba3a4f6cc6a9a29c67b325d8a6a5d3b081f97773.tar.xz
rust-ba3a4f6cc6a9a29c67b325d8a6a5d3b081f97773.zip
rustc: Cap ridiculous type name sizes
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/ty.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index 04bea450..24078767 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -630,7 +630,9 @@ fn ty_to_str(ctxt cx, &t typ) -> str {
fn ty_to_abbrev_str(ctxt cx, t typ) -> str {
auto f = def_to_str;
auto ecx = @rec(ds=f, tcx=cx);
- ret metadata.Encode.ty_str(ecx, typ);
+ auto s = metadata.Encode.ty_str(ecx, typ);
+ if (_str.byte_len(s) >= 64u) { s = _str.substr(s, 0u, 64u); }
+ ret s;
}
// Type folds