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 fc532c5b32
commit 8cf9eea5b3
102 changed files with 146 additions and 150 deletions

View file

@ -105,7 +105,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingInline {
// note: we need to check if the trait is exported so we can't use
// `LateLintPass::check_trait_item` here.
for tit in trait_items {
let tit_ = cx.tcx.hir().trait_item(tit.id);
let tit_ = cx.tcx.hir_trait_item(tit.id);
match tit_.kind {
hir::TraitItemKind::Const(..) | hir::TraitItemKind::Type(..) => {},
hir::TraitItemKind::Fn(..) => {
@ -113,7 +113,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingInline {
// trait method with default body needs inline in case
// an impl is not provided
let desc = "a default trait method";
let item = cx.tcx.hir().trait_item(tit.id);
let item = cx.tcx.hir_trait_item(tit.id);
let attrs = cx.tcx.hir().attrs(item.hir_id());
check_missing_inline_attrs(cx, attrs, item.span, desc);
}