FieldDef
This commit is contained in:
parent
a8e75c53d0
commit
f2f7d32948
1 changed files with 13 additions and 5 deletions
|
@ -116,6 +116,10 @@ pub trait MutVisitor: Sized {
|
||||||
walk_fn_header(self, header);
|
walk_fn_header(self, header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visit_field_def(&mut self, fd: &mut FieldDef) {
|
||||||
|
walk_field_def(self, fd);
|
||||||
|
}
|
||||||
|
|
||||||
fn flat_map_field_def(&mut self, fd: FieldDef) -> SmallVec<[FieldDef; 1]> {
|
fn flat_map_field_def(&mut self, fd: FieldDef) -> SmallVec<[FieldDef; 1]> {
|
||||||
walk_flat_map_field_def(self, fd)
|
walk_flat_map_field_def(self, fd)
|
||||||
}
|
}
|
||||||
|
@ -1050,17 +1054,21 @@ fn walk_poly_trait_ref<T: MutVisitor>(vis: &mut T, p: &mut PolyTraitRef) {
|
||||||
vis.visit_span(span);
|
vis.visit_span(span);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn walk_flat_map_field_def<T: MutVisitor>(
|
pub fn walk_field_def<T: MutVisitor>(visitor: &mut T, fd: &mut FieldDef) {
|
||||||
visitor: &mut T,
|
let FieldDef { span, ident, vis, id, ty, attrs, is_placeholder: _ } = fd;
|
||||||
mut fd: FieldDef,
|
|
||||||
) -> SmallVec<[FieldDef; 1]> {
|
|
||||||
let FieldDef { span, ident, vis, id, ty, attrs, is_placeholder: _ } = &mut fd;
|
|
||||||
visitor.visit_id(id);
|
visitor.visit_id(id);
|
||||||
visit_attrs(visitor, attrs);
|
visit_attrs(visitor, attrs);
|
||||||
visitor.visit_vis(vis);
|
visitor.visit_vis(vis);
|
||||||
visit_opt(ident, |ident| visitor.visit_ident(ident));
|
visit_opt(ident, |ident| visitor.visit_ident(ident));
|
||||||
visitor.visit_ty(ty);
|
visitor.visit_ty(ty);
|
||||||
visitor.visit_span(span);
|
visitor.visit_span(span);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn walk_flat_map_field_def<T: MutVisitor>(
|
||||||
|
vis: &mut T,
|
||||||
|
mut fd: FieldDef,
|
||||||
|
) -> SmallVec<[FieldDef; 1]> {
|
||||||
|
vis.visit_field_def(&mut fd);
|
||||||
smallvec![fd]
|
smallvec![fd]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue