diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-01-21 21:13:15 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-02-07 09:38:24 +0300 |
| commit | a61019b29021b7635113b48e470dbac724c81c76 (patch) | |
| tree | d921bd8920ffd7c06ba0c043892ce31dc4fbeead /src/librustdoc/html/render/span_map.rs | |
| parent | 363b098245c44401dda0040c80624187539c3141 (diff) | |
| download | rust-a61019b29021b7635113b48e470dbac724c81c76.tar.gz rust-a61019b29021b7635113b48e470dbac724c81c76.zip | |
hir: Remove `fn opt_hir_id` and `fn opt_span`
Diffstat (limited to 'src/librustdoc/html/render/span_map.rs')
| -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)), |
