Gensym remaining identifiers
This commit is contained in:
parent
a3241d1350
commit
b9b650c412
4 changed files with 5 additions and 5 deletions
|
@ -64,7 +64,7 @@ pub fn ordering_collapsed(cx: &mut ExtCtxt,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cs_cmp(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> {
|
pub fn cs_cmp(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> {
|
||||||
let test_id = cx.ident_of("__cmp");
|
let test_id = cx.ident_of("cmp").gensym();
|
||||||
let equals_path = cx.path_global(span, cx.std_path(&["cmp", "Ordering", "Equal"]));
|
let equals_path = cx.path_global(span, cx.std_path(&["cmp", "Ordering", "Equal"]));
|
||||||
|
|
||||||
let cmp_path = cx.std_path(&["cmp", "Ord", "cmp"]);
|
let cmp_path = cx.std_path(&["cmp", "Ord", "cmp"]);
|
||||||
|
|
|
@ -123,7 +123,7 @@ pub fn some_ordering_collapsed(cx: &mut ExtCtxt,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> {
|
pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> {
|
||||||
let test_id = cx.ident_of("__cmp");
|
let test_id = cx.ident_of("cmp").gensym();
|
||||||
let ordering = cx.path_global(span, cx.std_path(&["cmp", "Ordering", "Equal"]));
|
let ordering = cx.path_global(span, cx.std_path(&["cmp", "Ordering", "Equal"]));
|
||||||
let ordering_expr = cx.expr_path(ordering.clone());
|
let ordering_expr = cx.expr_path(ordering.clone());
|
||||||
let equals_expr = cx.expr_some(span, ordering_expr);
|
let equals_expr = cx.expr_some(span, ordering_expr);
|
||||||
|
|
|
@ -70,7 +70,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<E
|
||||||
// We want to make sure we have the ctxt set so that we can use unstable methods
|
// We want to make sure we have the ctxt set so that we can use unstable methods
|
||||||
let span = span.with_ctxt(cx.backtrace());
|
let span = span.with_ctxt(cx.backtrace());
|
||||||
let name = cx.expr_lit(span, ast::LitKind::Str(ident.name, ast::StrStyle::Cooked));
|
let name = cx.expr_lit(span, ast::LitKind::Str(ident.name, ast::StrStyle::Cooked));
|
||||||
let builder = Ident::from_str("__debug_trait_builder");
|
let builder = Ident::from_str("debug_trait_builder").gensym();
|
||||||
let builder_expr = cx.expr_ident(span, builder.clone());
|
let builder_expr = cx.expr_ident(span, builder.clone());
|
||||||
|
|
||||||
let fmt = substr.nonself_args[0].clone();
|
let fmt = substr.nonself_args[0].clone();
|
||||||
|
|
|
@ -1240,7 +1240,7 @@ impl<'a> MethodDef<'a> {
|
||||||
let vi_idents: Vec<ast::Ident> = self_arg_names.iter()
|
let vi_idents: Vec<ast::Ident> = self_arg_names.iter()
|
||||||
.map(|name| {
|
.map(|name| {
|
||||||
let vi_suffix = format!("{}_vi", &name[..]);
|
let vi_suffix = format!("{}_vi", &name[..]);
|
||||||
cx.ident_of(&vi_suffix[..])
|
cx.ident_of(&vi_suffix[..]).gensym()
|
||||||
})
|
})
|
||||||
.collect::<Vec<ast::Ident>>();
|
.collect::<Vec<ast::Ident>>();
|
||||||
|
|
||||||
|
@ -1616,7 +1616,7 @@ impl<'a> TraitDef<'a> {
|
||||||
let mut ident_exprs = Vec::new();
|
let mut ident_exprs = Vec::new();
|
||||||
for (i, struct_field) in struct_def.fields().iter().enumerate() {
|
for (i, struct_field) in struct_def.fields().iter().enumerate() {
|
||||||
let sp = struct_field.span.with_ctxt(self.span.ctxt());
|
let sp = struct_field.span.with_ctxt(self.span.ctxt());
|
||||||
let ident = cx.ident_of(&format!("{}_{}", prefix, i));
|
let ident = cx.ident_of(&format!("{}_{}", prefix, i)).gensym();
|
||||||
paths.push(ident.with_span_pos(sp));
|
paths.push(ident.with_span_pos(sp));
|
||||||
let val = cx.expr_path(cx.path_ident(sp, ident));
|
let val = cx.expr_path(cx.path_ident(sp, ident));
|
||||||
let val = if use_temporaries {
|
let val = if use_temporaries {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue