let trait_def = TraitDef {
span,
- attributes: Vec::new(),
path: path_std!(fmt::Debug),
additional_bounds: Vec::new(),
generics: Bounds::empty(),
explicit_self: true,
nonself_args: vec![(fmtr, sym::f)],
ret_ty: Path(path_std!(fmt::Result)),
- attributes: Vec::new(),
+ attributes: ast::AttrVec::new(),
unify_fieldless_variants: false,
combine_substructure: combine_substructure(Box::new(|a, b, c| {
show_substructure(a, b, c)
// We want to make sure we have the ctxt set so that we can use unstable methods
let span = cx.with_def_site_ctxt(span);
- let name = cx.expr_lit(span, ast::LitKind::Str(ident.name, ast::StrStyle::Cooked));
+ let name = cx.expr_str(span, ident.name);
let fmt = substr.nonselflike_args[0].clone();
// Struct and tuples are similar enough that we use the same code for both,
for i in 0..fields.len() {
let field = &fields[i];
if is_struct {
- let name = cx.expr_lit(
- field.span,
- ast::LitKind::Str(field.name.unwrap().name, ast::StrStyle::Cooked),
- );
+ let name = cx.expr_str(field.span, field.name.unwrap().name);
args.push(name);
}
// Use an extra indirection to make sure this works for unsized types.
for field in fields {
if is_struct {
- name_exprs.push(cx.expr_lit(
- field.span,
- ast::LitKind::Str(field.name.unwrap().name, ast::StrStyle::Cooked),
- ));
+ name_exprs.push(cx.expr_str(field.span, field.name.unwrap().name));
}
// Use an extra indirection to make sure this works for unsized types.