summaryrefslogtreecommitdiffstats
path: root/src/librustdoc/html/render/span_map.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:53 +0000
commit73e0a5b7696ea019ba35b89f38fc8e7b285d99cb (patch)
tree0d2e175af6f114cb50a675bec0bc76e12e1bceb4 /src/librustdoc/html/render/span_map.rs
parentAdding upstream version 1.75.0+dfsg1. (diff)
downloadrustc-upstream.tar.xz
rustc-upstream.zip
Adding upstream version 1.76.0+dfsg1.upstream/1.76.0+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/librustdoc/html/render/span_map.rs')
-rw-r--r--src/librustdoc/html/render/span_map.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/render/span_map.rs b/src/librustdoc/html/render/span_map.rs
index 5f130f187..d1ece7337 100644
--- a/src/librustdoc/html/render/span_map.rs
+++ b/src/librustdoc/html/render/span_map.rs
@@ -94,7 +94,7 @@ impl<'tcx> SpanMapVisitor<'tcx> {
/// Used to generate links on items' definition to go to their documentation page.
pub(crate) fn extract_info_from_hir_id(&mut self, hir_id: HirId) {
- if let Some(Node::Item(item)) = self.tcx.hir().find(hir_id) {
+ if let Some(Node::Item(item)) = self.tcx.opt_hir_node(hir_id) {
if let Some(span) = self.tcx.def_ident_span(item.owner_id) {
let cspan = clean::Span::new(span);
// If the span isn't from the current crate, we ignore it.
@@ -177,7 +177,7 @@ impl<'tcx> Visitor<'tcx> for SpanMapVisitor<'tcx> {
if !span.overlaps(m.spans.inner_span) {
// Now that we confirmed it's a file import, we want to get the span for the module
// name only and not all the "mod foo;".
- if let Some(Node::Item(item)) = self.tcx.hir().find(id) {
+ if let Some(Node::Item(item)) = self.tcx.opt_hir_node(id) {
self.matches.insert(
item.ident.span,
LinkFromSrc::Local(clean::Span::new(m.spans.inner_span)),