diff options
| author | bors <bors@rust-lang.org> | 2022-09-14 05:21:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-14 05:21:14 +0000 |
| commit | a0d1df4a5d6ed476e02ad46031dfcdb123fc0e84 (patch) | |
| tree | 2ef5cd9fbe79ec1310bb3c1622033710115c551d /compiler/rustc_ast_lowering/src | |
| parent | a5b58addae4d629734ebbfc9c69f4e0653b99569 (diff) | |
| parent | b8ed1c5745ab2fe80b216b00cd68def6d2a2aae9 (diff) | |
| download | rust-a0d1df4a5d6ed476e02ad46031dfcdb123fc0e84.tar.gz rust-a0d1df4a5d6ed476e02ad46031dfcdb123fc0e84.zip | |
Auto merge of #101709 - nnethercote:simplify-visitors-more, r=cjgillot
Simplify visitors more A successor to #100392. r? `@cjgillot`
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/index.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lifetime_collector.rs | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_ast_lowering/src/index.rs b/compiler/rustc_ast_lowering/src/index.rs index e732aed5a29..85846b56762 100644 --- a/compiler/rustc_ast_lowering/src/index.rs +++ b/compiler/rustc_ast_lowering/src/index.rs @@ -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>) { diff --git a/compiler/rustc_ast_lowering/src/lifetime_collector.rs b/compiler/rustc_ast_lowering/src/lifetime_collector.rs index 8c67cebae55..914fc5f58da 100644 --- a/compiler/rustc_ast_lowering/src/lifetime_collector.rs +++ b/compiler/rustc_ast_lowering/src/lifetime_collector.rs @@ -63,9 +63,9 @@ impl<'ast> Visitor<'ast> for LifetimeCollectVisitor<'ast> { self.record_lifetime_use(*lifetime); } - fn visit_path_segment(&mut self, path_span: Span, path_segment: &'ast PathSegment) { - self.record_elided_anchor(path_segment.id, path_span); - visit::walk_path_segment(self, path_span, path_segment); + fn visit_path_segment(&mut self, path_segment: &'ast PathSegment) { + self.record_elided_anchor(path_segment.id, path_segment.ident.span); + visit::walk_path_segment(self, path_segment); } fn visit_poly_trait_ref(&mut self, t: &'ast PolyTraitRef) { |
