Auto merge of #101709 - nnethercote:simplify-visitors-more, r=cjgillot
Simplify visitors more A successor to #100392. r? `@cjgillot`
This commit is contained in:
commit
a0d1df4a5d
26 changed files with 115 additions and 156 deletions
|
@ -246,9 +246,9 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
|||
});
|
||||
}
|
||||
|
||||
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'hir PathSegment<'hir>) {
|
||||
self.insert(path_span, path_segment.hir_id, Node::PathSegment(path_segment));
|
||||
intravisit::walk_path_segment(self, path_span, path_segment);
|
||||
fn visit_path_segment(&mut self, path_segment: &'hir PathSegment<'hir>) {
|
||||
self.insert(path_segment.ident.span, path_segment.hir_id, Node::PathSegment(path_segment));
|
||||
intravisit::walk_path_segment(self, path_segment);
|
||||
}
|
||||
|
||||
fn visit_ty(&mut self, ty: &'hir Ty<'hir>) {
|
||||
|
@ -280,12 +280,12 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
|||
fk: intravisit::FnKind<'hir>,
|
||||
fd: &'hir FnDecl<'hir>,
|
||||
b: BodyId,
|
||||
s: Span,
|
||||
_: Span,
|
||||
id: HirId,
|
||||
) {
|
||||
assert_eq!(self.owner, id.owner);
|
||||
assert_eq!(self.parent_node, id.local_id);
|
||||
intravisit::walk_fn(self, fk, fd, b, s, id);
|
||||
intravisit::walk_fn(self, fk, fd, b, id);
|
||||
}
|
||||
|
||||
fn visit_block(&mut self, block: &'hir Block<'hir>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue