Move some Map methods onto TyCtxt.

The end goal is to eliminate `Map` altogether.

I added a `hir_` prefix to all of them, that seemed simplest. The
exceptions are `module_items` which became `hir_module_free_items` because
there was already a `hir_module_items`, and `items` which became
`hir_free_items` for consistency with `hir_module_free_items`.
This commit is contained in:
Nicholas Nethercote
2025-02-03 10:45:49 +11:00
parent cd1d84cdf7
commit f86f7ad5f2
197 changed files with 465 additions and 476 deletions

View File

@@ -99,7 +99,7 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
self.context.cached_typeck_results.set(None);
}
let body = self.context.tcx.hir().body(body_id);
let body = self.context.tcx.hir_body(body_id);
self.visit_body(body);
self.context.enclosing_body = old_enclosing_body;
@@ -191,7 +191,7 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
// in order for `check_fn` to be able to use them.
let old_enclosing_body = self.context.enclosing_body.replace(body_id);
let old_cached_typeck_results = self.context.cached_typeck_results.take();
let body = self.context.tcx.hir().body(body_id);
let body = self.context.tcx.hir_body(body_id);
lint_callback!(self, check_fn, fk, decl, body, span, id);
hir_visit::walk_fn(self, fk, decl, body_id, id);
self.context.enclosing_body = old_enclosing_body;