From 7c50b82ffe7962495714e874ad66cc053bb2a369 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Fri, 23 Apr 2021 15:51:47 -0400 Subject: [PATCH] rustdoc: Remove unnecessary dummy span --- src/librustdoc/visit_ast.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index ca30d8f0d4623..d852728b74962 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -71,9 +71,10 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { } crate fn visit(mut self, krate: &'tcx hir::Crate<'_>) -> Module<'tcx> { + let span = krate.item.inner; let mut top_level_module = self.visit_mod_contents( - krate.item.inner, - &Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Public }, + span, + &Spanned { span, node: hir::VisibilityKind::Public }, hir::CRATE_HIR_ID, &krate.item, self.cx.tcx.crate_name, @@ -130,7 +131,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { fn visit_mod_contents( &mut self, span: Span, - vis: &'tcx hir::Visibility<'_>, + vis: &hir::Visibility<'_>, id: hir::HirId, m: &'tcx hir::Mod<'tcx>, name: Symbol,