diff options
| author | bors <bors@rust-lang.org> | 2025-02-18 04:26:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-02-18 04:26:30 +0000 |
| commit | aaa861493456e8a10e552dd208f85486de772007 (patch) | |
| tree | 1d0a87efba6dcbd2965ed32f05d25f4950363883 /src/librustdoc/html | |
| parent | de91711756133f11f7861dd099c001eaff0aafaa (diff) | |
| parent | fd7b4bf4e19b19ebf9b536790ec1668a3e50fe6f (diff) | |
| download | rust-aaa861493456e8a10e552dd208f85486de772007.tar.gz rust-aaa861493456e8a10e552dd208f85486de772007.zip | |
Auto merge of #137162 - nnethercote:remove-Map-2, r=Zalathar
Move methods from `Map` to `TyCtxt`, part 2. Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that. r? Zalathar
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/render/span_map.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustdoc/html/render/span_map.rs b/src/librustdoc/html/render/span_map.rs index fa2465c1926..658d5965b3d 100644 --- a/src/librustdoc/html/render/span_map.rs +++ b/src/librustdoc/html/render/span_map.rs @@ -51,7 +51,7 @@ pub(crate) fn collect_spans_and_sources( let mut visitor = SpanMapVisitor { tcx, matches: FxHashMap::default() }; if generate_link_to_definition { - tcx.hir().walk_toplevel_module(&mut visitor); + tcx.hir_walk_toplevel_module(&mut visitor); } let sources = sources::collect_local_sources(tcx, src_root, krate); (sources, visitor.matches) @@ -173,18 +173,18 @@ impl SpanMapVisitor<'_> { } fn infer_id(&mut self, hir_id: HirId, expr_hir_id: Option<HirId>, span: Span) { - let hir = self.tcx.hir(); - let body_id = hir.enclosing_body_owner(hir_id); + let tcx = self.tcx; + let body_id = tcx.hir_enclosing_body_owner(hir_id); // FIXME: this is showing error messages for parts of the code that are not // compiled (because of cfg)! // // See discussion in https://github.com/rust-lang/rust/issues/69426#issuecomment-1019412352 - let typeck_results = self.tcx.typeck_body(hir.body_owned_by(body_id).id()); + let typeck_results = tcx.typeck_body(tcx.hir_body_owned_by(body_id).id()); // Interestingly enough, for method calls, we need the whole expression whereas for static // method/function calls, we need the call expression specifically. if let Some(def_id) = typeck_results.type_dependent_def_id(expr_hir_id.unwrap_or(hir_id)) { let link = if def_id.as_local().is_some() { - LinkFromSrc::Local(rustc_span(def_id, self.tcx)) + LinkFromSrc::Local(rustc_span(def_id, tcx)) } else { LinkFromSrc::External(def_id) }; |
