1
Fork 0

Rollup merge of #126620 - oli-obk:taint_errors, r=fee1-dead

Actually taint InferCtxt when a fulfillment error is emitted

And avoid checking the global error counter

fixes #122044
fixes #123255
fixes #123276
fixes #125799
This commit is contained in:
Matthias Krüger 2024-06-20 07:52:43 +02:00 committed by GitHub
commit e7be3562b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 595 additions and 238 deletions

View file

@ -119,16 +119,7 @@ where
let errors = wfcx.select_all_or_error();
if !errors.is_empty() {
let err = infcx.err_ctxt().report_fulfillment_errors(errors);
if tcx.dcx().has_errors().is_some() {
return Err(err);
} else {
// HACK(oli-obk): tests/ui/specialization/min_specialization/specialize_on_type_error.rs
// causes an delayed bug during normalization, without reporting an error, so we need
// to act as if no error happened, in order to let our callers continue and report an
// error later in check_impl_items_against_trait.
return Ok(());
}
return Err(infcx.err_ctxt().report_fulfillment_errors(errors));
}
debug!(?assumed_wf_types);