Skip to content

Commit ff3d902

Browse files
committed
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$.
1 parent 75a39e0 commit ff3d902

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/middle/trans/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub fn return_type_is_void(ccx: &CrateContext, ty: ty::t) -> bool {
106106
/// Generates a unique symbol based off the name given. This is used to create
107107
/// unique symbols for things like closures.
108108
pub fn gensym_name(name: &str) -> PathElem {
109-
let num = token::gensym(name);
109+
let num = token::gensym(name).uint();
110110
// use one colon which will get translated to a period by the mangler, and
111111
// we're guaranteed that `num` is globally unique for this crate.
112112
PathName(token::gensym(format!("{}:{}", name, num).as_slice()))

0 commit comments

Comments
 (0)