Fix symbol mangling in the presence of trailing version numbers.

This commit is contained in:
Graydon Hoare 2012-05-01 17:21:06 -07:00
parent 79ed1f2df4
commit 1c1af99052

View File

@ -466,6 +466,14 @@ fn sanitize(s: str) -> str {
}
}
}
// Underscore-qualify anything that didn't start as an ident.
if result.len() > 0u &&
result[0] != '_' as u8 &&
! char::is_XID_start(result[0] as char) {
ret "_" + result;
}
ret result;
}