about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2014-07-31 19:05:45 -0700
committerKevin Ballard <kevin@sb.org>2014-07-31 19:05:45 -0700
commitff3d902fcbcdddc885e03ffe3f84bc9dcb003cec (patch)
tree7ae5519d53fe432247d7c7deb0d3f8a2f65d2d96 /src
parent75a39e0fb8fef20d72f7279686ec266bb9cec127 (diff)
downloadrust-ff3d902fcbcdddc885e03ffe3f84bc9dcb003cec.tar.gz
rust-ff3d902fcbcdddc885e03ffe3f84bc9dcb003cec.zip
Stop using the Show impl for ast::Name in our symbols
When generating a unique symbol for things like closures or glue_drop,
we call token::gensym() to create a crate-unique Name. Recently, Name
changed its Show impl so it no longer prints as a number. This caused
symbols like glue_drop:1542 to become glue_drop:"glue_drop"(1542), or in
mangled form, glue_drop.$x22glue_drop$x22$LP$1542$RP$.
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/trans/common.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs
index 71ddc2e4045..7fe3db7534f 100644
--- a/src/librustc/middle/trans/common.rs
+++ b/src/librustc/middle/trans/common.rs
@@ -106,7 +106,7 @@ pub fn return_type_is_void(ccx: &CrateContext, ty: ty::t) -> bool {
 /// Generates a unique symbol based off the name given. This is used to create
 /// unique symbols for things like closures.
 pub fn gensym_name(name: &str) -> PathElem {
-    let num = token::gensym(name);
+    let num = token::gensym(name).uint();
     // use one colon which will get translated to a period by the mangler, and
     // we're guaranteed that `num` is globally unique for this crate.
     PathName(token::gensym(format!("{}:{}", name, num).as_slice()))