Skip to content

Commit b9b650c

Browse files
committed
Gensym remaining identifiers
1 parent a3241d1 commit b9b650c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/libsyntax_ext/deriving/cmp/ord.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn ordering_collapsed(cx: &mut ExtCtxt,
6464
}
6565

6666
pub fn cs_cmp(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> {
67-
let test_id = cx.ident_of("__cmp");
67+
let test_id = cx.ident_of("cmp").gensym();
6868
let equals_path = cx.path_global(span, cx.std_path(&["cmp", "Ordering", "Equal"]));
6969

7070
let cmp_path = cx.std_path(&["cmp", "Ord", "cmp"]);

src/libsyntax_ext/deriving/cmp/partial_ord.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn some_ordering_collapsed(cx: &mut ExtCtxt,
123123
}
124124

125125
pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> {
126-
let test_id = cx.ident_of("__cmp");
126+
let test_id = cx.ident_of("cmp").gensym();
127127
let ordering = cx.path_global(span, cx.std_path(&["cmp", "Ordering", "Equal"]));
128128
let ordering_expr = cx.expr_path(ordering.clone());
129129
let equals_expr = cx.expr_some(span, ordering_expr);

src/libsyntax_ext/deriving/debug.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<E
7070
// We want to make sure we have the ctxt set so that we can use unstable methods
7171
let span = span.with_ctxt(cx.backtrace());
7272
let name = cx.expr_lit(span, ast::LitKind::Str(ident.name, ast::StrStyle::Cooked));
73-
let builder = Ident::from_str("__debug_trait_builder");
73+
let builder = Ident::from_str("debug_trait_builder").gensym();
7474
let builder_expr = cx.expr_ident(span, builder.clone());
7575

7676
let fmt = substr.nonself_args[0].clone();

src/libsyntax_ext/deriving/generic/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ impl<'a> MethodDef<'a> {
12401240
let vi_idents: Vec<ast::Ident> = self_arg_names.iter()
12411241
.map(|name| {
12421242
let vi_suffix = format!("{}_vi", &name[..]);
1243-
cx.ident_of(&vi_suffix[..])
1243+
cx.ident_of(&vi_suffix[..]).gensym()
12441244
})
12451245
.collect::<Vec<ast::Ident>>();
12461246

@@ -1616,7 +1616,7 @@ impl<'a> TraitDef<'a> {
16161616
let mut ident_exprs = Vec::new();
16171617
for (i, struct_field) in struct_def.fields().iter().enumerate() {
16181618
let sp = struct_field.span.with_ctxt(self.span.ctxt());
1619-
let ident = cx.ident_of(&format!("{}_{}", prefix, i));
1619+
let ident = cx.ident_of(&format!("{}_{}", prefix, i)).gensym();
16201620
paths.push(ident.with_span_pos(sp));
16211621
let val = cx.expr_path(cx.path_ident(sp, ident));
16221622
let val = if use_temporaries {

0 commit comments

Comments
 (0)