1
Fork 0

Auto merge of #121500 - oli-obk:track_errors12, r=petrochenkov

Merge `collect_mod_item_types` query into `check_well_formed`

follow-up to https://github.com/rust-lang/rust/pull/121154

this removes more potential parallel-compiler bottlenecks and moves diagnostics for the same items next to each other, instead of grouping diagnostics by analysis kind
This commit is contained in:
bors 2024-03-08 15:06:36 +00:00
commit 74acabe9b0
67 changed files with 1102 additions and 1113 deletions

View file

@ -20,7 +20,7 @@ use rustc_data_structures::unord::UnordMap;
use rustc_errors::{Applicability, Diag, ErrorGuaranteed, StashKey};
use rustc_hir as hir;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId};
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::{GenericParamKind, Node};
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
@ -52,11 +52,6 @@ mod resolve_bound_vars;
mod type_of;
///////////////////////////////////////////////////////////////////////////
// Main entry point
fn collect_mod_item_types(tcx: TyCtxt<'_>, module_def_id: LocalModDefId) {
tcx.hir().visit_item_likes_in_module(module_def_id, &mut CollectItemTypesVisitor { tcx });
}
pub fn provide(providers: &mut Providers) {
resolve_bound_vars::provide(providers);
@ -82,7 +77,6 @@ pub fn provide(providers: &mut Providers) {
impl_trait_header,
coroutine_kind,
coroutine_for_closure,
collect_mod_item_types,
is_type_alias_impl_trait,
find_field,
..*providers
@ -155,8 +149,8 @@ impl<'v> Visitor<'v> for HirPlaceholderCollector {
}
}
struct CollectItemTypesVisitor<'tcx> {
tcx: TyCtxt<'tcx>,
pub struct CollectItemTypesVisitor<'tcx> {
pub tcx: TyCtxt<'tcx>,
}
/// If there are any placeholder types (`_`), emit an error explaining that this is not allowed