}
pub fn noop_fold_struct_field<T: Folder>(f: StructField, fld: &mut T) -> StructField {
- let StructField {node: StructField_ {id, kind, ty, attrs}, span} = f;
- Spanned {
- node: StructField_ {
- id: fld.new_id(id),
- kind: kind,
- ty: fld.fold_ty(ty),
- attrs: fold_attrs(attrs, fld),
- },
- span: fld.new_span(span),
+ StructField {
+ span: fld.new_span(f.span),
+ id: fld.new_id(f.id),
+ name: f.name,
+ vis: f.vis,
+ ty: fld.fold_ty(f.ty),
+ attrs: fold_attrs(f.attrs, fld),
}
}
name: folder.fold_name(i.name),
attrs: fold_attrs(i.attrs, folder),
vis: i.vis,
+ defaultness: i.defaultness,
node: match i.node {
ImplItemKind::Const(ty, expr) => {
ImplItemKind::Const(folder.fold_ty(ty), folder.fold_expr(expr))
ExprIndex(el, er) => {
ExprIndex(folder.fold_expr(el), folder.fold_expr(er))
}
- ExprRange(e1, e2) => {
- ExprRange(e1.map(|x| folder.fold_expr(x)),
- e2.map(|x| folder.fold_expr(x)))
- }
ExprPath(qself, path) => {
let qself = qself.map(|QSelf { ty, position }| {
QSelf {
respan(folder.new_span(label.span), folder.fold_ident(label.node))
})),
ExprRet(e) => ExprRet(e.map(|x| folder.fold_expr(x))),
- ExprInlineAsm(InlineAsm {
- inputs,
- outputs,
- asm,
- asm_str_style,
- clobbers,
- volatile,
- alignstack,
- dialect,
- expn_id,
- }) => ExprInlineAsm(InlineAsm {
- inputs: inputs.move_map(|(c, input)| (c, folder.fold_expr(input))),
- outputs: outputs.move_map(|out| {
- InlineAsmOutput {
- constraint: out.constraint,
- expr: folder.fold_expr(out.expr),
- is_rw: out.is_rw,
- is_indirect: out.is_indirect,
- }
- }),
- asm: asm,
- asm_str_style: asm_str_style,
- clobbers: clobbers,
- volatile: volatile,
- alignstack: alignstack,
- dialect: dialect,
- expn_id: expn_id,
- }),
+ ExprInlineAsm(asm, outputs, inputs) => {
+ ExprInlineAsm(asm,
+ outputs.move_map(|x| folder.fold_expr(x)),
+ inputs.move_map(|x| folder.fold_expr(x)))
+ }
ExprStruct(path, fields, maybe_expr) => {
ExprStruct(folder.fold_path(path),
fields.move_map(|x| folder.fold_field(x)),