]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_passes/src/hir_stats.rs
Auto merge of #102106 - djkoloski:sync-from-clippy, r=Manishearth
[rust.git] / compiler / rustc_passes / src / hir_stats.rs
index 81ac0e1b6d445a5455a69a9e9782ff788a62728b..0be2fc05344679875b189d312f086c7fe282b4ad 100644 (file)
@@ -362,11 +362,11 @@ fn visit_fn(
         fk: hir_visit::FnKind<'v>,
         fd: &'v hir::FnDecl<'v>,
         b: hir::BodyId,
-        s: Span,
+        _: Span,
         id: hir::HirId,
     ) {
         self.record("FnDecl", Id::None, fd);
-        hir_visit::walk_fn(self, fk, fd, b, s, id)
+        hir_visit::walk_fn(self, fk, fd, b, id)
     }
 
     fn visit_use(&mut self, p: &'v hir::Path<'v>, hir_id: hir::HirId) {
@@ -437,19 +437,24 @@ fn visit_generic_arg(&mut self, ga: &'v hir::GenericArg<'v>) {
         }
     }
 
+    fn visit_lifetime(&mut self, lifetime: &'v hir::Lifetime) {
+        self.record("Lifetime", Id::Node(lifetime.hir_id), lifetime);
+        hir_visit::walk_lifetime(self, lifetime)
+    }
+
     fn visit_path(&mut self, path: &'v hir::Path<'v>, _id: hir::HirId) {
         self.record("Path", Id::None, path);
         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>) {
@@ -607,9 +612,9 @@ fn visit_where_predicate(&mut self, p: &'v ast::WherePredicate) {
         ast_visit::walk_where_predicate(self, p)
     }
 
-    fn visit_fn(&mut self, fk: ast_visit::FnKind<'v>, s: Span, _: NodeId) {
+    fn visit_fn(&mut self, fk: ast_visit::FnKind<'v>, _: Span, _: NodeId) {
         self.record("FnDecl", Id::None, fk.decl());
-        ast_visit::walk_fn(self, fk, s)
+        ast_visit::walk_fn(self, fk)
     }
 
     fn visit_assoc_item(&mut self, i: &'v ast::AssocItem, ctxt: ast_visit::AssocCtxt) {
@@ -647,21 +652,21 @@ fn visit_variant(&mut self, v: &'v ast::Variant) {
     // 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) {