Skip to content

Commit ba3a4f6

Browse files
committed
rustc: Cap ridiculous type name sizes
1 parent 79d27cc commit ba3a4f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/comp/middle/ty.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ fn ty_to_str(ctxt cx, &t typ) -> str {
630630
fn ty_to_abbrev_str(ctxt cx, t typ) -> str {
631631
auto f = def_to_str;
632632
auto ecx = @rec(ds=f, tcx=cx);
633-
ret metadata.Encode.ty_str(ecx, typ);
633+
auto s = metadata.Encode.ty_str(ecx, typ);
634+
if (_str.byte_len(s) >= 64u) { s = _str.substr(s, 0u, 64u); }
635+
ret s;
634636
}
635637

636638
// Type folds

0 commit comments

Comments
 (0)