Skip to content

Commit f2f7d32

Browse files
committed
FieldDef
1 parent a8e75c5 commit f2f7d32

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ pub trait MutVisitor: Sized {
116116
walk_fn_header(self, header);
117117
}
118118

119+
fn visit_field_def(&mut self, fd: &mut FieldDef) {
120+
walk_field_def(self, fd);
121+
}
122+
119123
fn flat_map_field_def(&mut self, fd: FieldDef) -> SmallVec<[FieldDef; 1]> {
120124
walk_flat_map_field_def(self, fd)
121125
}
@@ -1050,17 +1054,21 @@ fn walk_poly_trait_ref<T: MutVisitor>(vis: &mut T, p: &mut PolyTraitRef) {
10501054
vis.visit_span(span);
10511055
}
10521056

1053-
pub fn walk_flat_map_field_def<T: MutVisitor>(
1054-
visitor: &mut T,
1055-
mut fd: FieldDef,
1056-
) -> SmallVec<[FieldDef; 1]> {
1057-
let FieldDef { span, ident, vis, id, ty, attrs, is_placeholder: _ } = &mut fd;
1057+
pub fn walk_field_def<T: MutVisitor>(visitor: &mut T, fd: &mut FieldDef) {
1058+
let FieldDef { span, ident, vis, id, ty, attrs, is_placeholder: _ } = fd;
10581059
visitor.visit_id(id);
10591060
visit_attrs(visitor, attrs);
10601061
visitor.visit_vis(vis);
10611062
visit_opt(ident, |ident| visitor.visit_ident(ident));
10621063
visitor.visit_ty(ty);
10631064
visitor.visit_span(span);
1065+
}
1066+
1067+
pub fn walk_flat_map_field_def<T: MutVisitor>(
1068+
vis: &mut T,
1069+
mut fd: FieldDef,
1070+
) -> SmallVec<[FieldDef; 1]> {
1071+
vis.visit_field_def(&mut fd);
10641072
smallvec![fd]
10651073
}
10661074

0 commit comments

Comments
 (0)