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:
@@ -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()
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user