Skip to content

Commit

Permalink
ast: Visit item components in "natural" order
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Apr 25, 2024
1 parent 5be9fdd commit 7517a4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_ast/src/mut_visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,11 +1248,11 @@ pub fn noop_flat_map_item<K: NoopVisitItemKind>(
visitor: &mut impl MutVisitor,
) -> SmallVec<[P<Item<K>>; 1]> {
let Item { ident, attrs, id, kind, vis, span, tokens } = item.deref_mut();
visitor.visit_ident(ident);
visit_attrs(attrs, visitor);
visitor.visit_id(id);
kind.noop_visit(visitor);
visit_attrs(attrs, visitor);
visitor.visit_vis(vis);
visitor.visit_ident(ident);
kind.noop_visit(visitor);
visitor.visit_span(span);
visit_lazy_tts(tokens, visitor);
smallvec![item]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,9 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(
ctxt: AssocCtxt,
) -> V::Result {
let &Item { id: _, span: _, ident, ref vis, ref attrs, ref kind, tokens: _ } = item;
walk_list!(visitor, visit_attribute, attrs);
try_visit!(visitor.visit_vis(vis));
try_visit!(visitor.visit_ident(ident));
walk_list!(visitor, visit_attribute, attrs);
try_visit!(kind.walk(item, ctxt, visitor));
V::Result::output()
}
Expand Down

0 comments on commit 7517a4f

Please sign in to comment.