diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2024-02-10 05:02:28 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2024-02-10 05:02:28 +0000 |
| commit | 3e97b415c3df72d39f99f07f8f5c82ed34a7afaa (patch) | |
| tree | 0ea8b63cd62bbfdb0925579bf6e08673cfdee317 /src/librustdoc/html/render | |
| parent | d4b8ed007376f869f69c389c900d5fb3a9c4b5ac (diff) | |
| parent | 29fd82b24e8990ab133cb07d7c670202a197743e (diff) | |
| download | rust-3e97b415c3df72d39f99f07f8f5c82ed34a7afaa.tar.gz rust-3e97b415c3df72d39f99f07f8f5c82ed34a7afaa.zip | |
Merge from rustc
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/span_map.rs | 4 |
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 b055e355b78..8ee35db56f8 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.opt_hir_node(hir_id) { + if let Node::Item(item) = self.tcx.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. @@ -199,7 +199,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.opt_hir_node(id) { + if let Node::Item(item) = self.tcx.hir_node(id) { self.matches.insert( item.ident.span, LinkFromSrc::Local(clean::Span::new(m.spans.inner_span)), |
