Remove track_errors entirely

This commit is contained in:
Oli Scherer
2024-01-23 15:23:22 +00:00
parent 0e4243538b
commit db7cd57091
26 changed files with 496 additions and 200 deletions

View File

@@ -172,19 +172,15 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
tcx.sess.time("coherence_checking", || {
// Check impls constrain their parameters
let res =
let mut res =
tcx.hir().try_par_for_each_module(|module| tcx.ensure().check_mod_impl_wf(module));
// FIXME(matthewjasper) We shouldn't need to use `track_errors` anywhere in this function
// or the compiler in general.
res.and(tcx.sess.track_errors(|| {
for &trait_def_id in tcx.all_local_trait_impls(()).keys() {
tcx.ensure().coherent_trait(trait_def_id);
}
}))
for &trait_def_id in tcx.all_local_trait_impls(()).keys() {
res = res.and(tcx.ensure().coherent_trait(trait_def_id));
}
// these queries are executed for side-effects (error reporting):
.and(tcx.ensure().crate_inherent_impls(()))
.and(tcx.ensure().crate_inherent_impls_overlap_check(()))
res.and(tcx.ensure().crate_inherent_impls(()))
.and(tcx.ensure().crate_inherent_impls_overlap_check(()))
})?;
if tcx.features().rustc_attrs {