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

@@ -679,7 +679,7 @@ fn infringing_fields_error<'tcx>(
suggest_constraining_type_params(
tcx,
tcx.hir().get_generics(impl_did).expect("impls always have generics"),
tcx.hir_get_generics(impl_did).expect("impls always have generics"),
&mut err,
bounds
.iter()

View File

@@ -25,7 +25,7 @@ pub(crate) fn crate_inherent_impls(
let mut collect = InherentCollect { tcx, impls_map: Default::default() };
let mut res = Ok(());
for id in tcx.hir().items() {
for id in tcx.hir_free_items() {
res = res.and(collect.check_item(id));
}

View File

@@ -18,7 +18,7 @@ pub(crate) fn crate_inherent_impls_overlap_check(
) -> Result<(), ErrorGuaranteed> {
let mut inherent_overlap_checker = InherentOverlapChecker { tcx };
let mut res = Ok(());
for id in tcx.hir().items() {
for id in tcx.hir_free_items() {
res = res.and(inherent_overlap_checker.check_item(id));
}
res