rustc: Lower the size limit on ty_to_short_str() and always call it in favor of direct calls to metadata.Encode.ty_str() in trans

This commit is contained in:
Patrick Walton 2011-05-10 17:49:20 -07:00
parent 404db4d9a1
commit 1448fc1a24
2 changed files with 2 additions and 2 deletions

View File

@ -210,7 +210,7 @@ fn mangle_name_by_type(@crate_ctxt ccx, vec[str] path, ty.t t) -> str {
fn mangle_name_by_type_only(@crate_ctxt ccx, ty.t t, str name) -> str {
auto f = metadata.def_to_str;
auto cx = @rec(ds=f, tcx=ccx.tcx, abbrevs=metadata.ac_no_abbrevs);
auto s = metadata.Encode.ty_str(cx, t);
auto s = ty.ty_to_short_str(ccx.tcx, t);
auto hash = get_type_sha1(ccx, t);
ret sep() + "rust" + sep() + hash + sep() + name + "_" + s;

View File

@ -661,7 +661,7 @@ fn ty_to_short_str(ctxt cx, t typ) -> str {
auto f = def_to_str;
auto ecx = @rec(ds=f, tcx=cx, abbrevs=metadata.ac_no_abbrevs);
auto s = metadata.Encode.ty_str(ecx, typ);
if (Str.byte_len(s) >= 64u) { s = Str.substr(s, 0u, 64u); }
if (Str.byte_len(s) >= 32u) { s = Str.substr(s, 0u, 32u); }
ret s;
}