Remove path_span
argument to the visit_path_segment
methods.
The `visit_path_segment` method of both the AST and HIR visitors has a `path_span` argument that isn't necessary. This commit removes it. There are two very small and inconsequential functional changes. - One call to `NodeCollector::insert` now is passed a path segment identifier span instead of a full path span. This span is only used in a panic message printed in the case of an internal compiler bug. - Likewise, one call to `LifetimeCollectVisitor::record_elided_anchor` now uses a path segment identifier span instead of a full path span. This span is used to make some `'_` lifetimes.
This commit is contained in:
parent
59e7a308e4
commit
6568ef338e
13 changed files with 57 additions and 75 deletions
|
@ -447,14 +447,14 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
|
|||
hir_visit::walk_path(self, path)
|
||||
}
|
||||
|
||||
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v hir::PathSegment<'v>) {
|
||||
fn visit_path_segment(&mut self, path_segment: &'v hir::PathSegment<'v>) {
|
||||
self.record("PathSegment", Id::None, path_segment);
|
||||
hir_visit::walk_path_segment(self, path_span, path_segment)
|
||||
hir_visit::walk_path_segment(self, path_segment)
|
||||
}
|
||||
|
||||
fn visit_generic_args(&mut self, sp: Span, ga: &'v hir::GenericArgs<'v>) {
|
||||
fn visit_generic_args(&mut self, ga: &'v hir::GenericArgs<'v>) {
|
||||
self.record("GenericArgs", Id::None, ga);
|
||||
hir_visit::walk_generic_args(self, sp, ga)
|
||||
hir_visit::walk_generic_args(self, ga)
|
||||
}
|
||||
|
||||
fn visit_assoc_type_binding(&mut self, type_binding: &'v hir::TypeBinding<'v>) {
|
||||
|
@ -652,21 +652,21 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> {
|
|||
// one non-inline use (in `ast::Path::segments`). The latter case is more
|
||||
// common than the former case, so we implement this visitor and tolerate
|
||||
// the double counting in the former case.
|
||||
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v ast::PathSegment) {
|
||||
fn visit_path_segment(&mut self, path_segment: &'v ast::PathSegment) {
|
||||
self.record("PathSegment", Id::None, path_segment);
|
||||
ast_visit::walk_path_segment(self, path_span, path_segment)
|
||||
ast_visit::walk_path_segment(self, path_segment)
|
||||
}
|
||||
|
||||
// `GenericArgs` has one inline use (in `ast::AssocConstraint::gen_args`) and one
|
||||
// non-inline use (in `ast::PathSegment::args`). The latter case is more
|
||||
// common, so we implement `visit_generic_args` and tolerate the double
|
||||
// counting in the former case.
|
||||
fn visit_generic_args(&mut self, sp: Span, g: &'v ast::GenericArgs) {
|
||||
fn visit_generic_args(&mut self, g: &'v ast::GenericArgs) {
|
||||
record_variants!(
|
||||
(self, g, g, Id::None, ast, GenericArgs, GenericArgs),
|
||||
[AngleBracketed, Parenthesized]
|
||||
);
|
||||
ast_visit::walk_generic_args(self, sp, g)
|
||||
ast_visit::walk_generic_args(self, g)
|
||||
}
|
||||
|
||||
fn visit_attribute(&mut self, attr: &'v ast::Attribute) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue