Skip to content

Commit 4ca981e

Browse files
committed
drop back to a simple gensym approach for fresh-name.
this is necessary so that the new idents are connected to the original strings. this is important both for error messages, and so that top-level refs get connected to the right things.
1 parent 9d5f124 commit 4ca981e

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/libsyntax/parse/token.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -543,18 +543,9 @@ pub fn gensym_ident(str : &str) -> ast::Ident {
543543
ast::Ident::new(gensym(str))
544544
}
545545

546-
547-
// create a fresh name. In principle, this is just a
548-
// gensym, but for debugging purposes, you'd like the
549-
// resulting name to have a suggestive stringify, without
550-
// paying the cost of guaranteeing that the name is
551-
// truly unique. I'm going to try to strike a balance
552-
// by using a gensym with a name that has a random number
553-
// at the end. So, the gensym guarantees the uniqueness,
554-
// and the int helps to avoid confusion.
555-
pub fn fresh_name(src_name : &ast::Ident) -> Name {
556-
let num = rand::rng().gen_uint_range(0,0xffff);
557-
gensym(fmt!("%s_%u",ident_to_str(src_name),num))
546+
// create a fresh name that maps to the same string as the old one.
547+
pub fn fresh_name(src : &ast::Ident) -> Name {
548+
gensym(ident_to_str(src))
558549
}
559550

560551
// create a fresh mark.

0 commit comments

Comments
 (0)