about summary refs log tree commit diff
path: root/compiler/rustc_passes/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-09-12 10:43:34 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-09-12 13:24:25 +1000
commit6568ef338efe046f23d3c9e2623ba0a392c85def (patch)
tree90a798eedb8027878a512813a9dd56e17bc35e74 /compiler/rustc_passes/src
parent59e7a308e40fbc6b0901c9a8ee8ed51b17f9e772 (diff)
downloadrust-6568ef338efe046f23d3c9e2623ba0a392c85def.tar.gz
rust-6568ef338efe046f23d3c9e2623ba0a392c85def.zip
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.
Diffstat (limited to 'compiler/rustc_passes/src')
-rw-r--r--compiler/rustc_passes/src/hir_stats.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_passes/src/hir_stats.rs b/compiler/rustc_passes/src/hir_stats.rs
index 075069feb52..d602b1a05ce 100644
--- a/compiler/rustc_passes/src/hir_stats.rs
+++ b/compiler/rustc_passes/src/hir_stats.rs
@@ -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) {