Rollup merge of #120531 - oli-obk:track_errors7, r=estebank

Remove a bunch of `has_errors` checks that have no meaningful or the wrong effect

r? `@nnethercote`
This commit is contained in:
Matthias Krüger 2024-02-03 22:25:16 +01:00 committed by GitHub
commit 7d516c57df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 121 additions and 38 deletions

View file

@ -448,8 +448,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
// FIXME(effects)
let predicate_is_const = false;
if let Some(guar) = self.dcx().has_errors()
&& trait_predicate.references_error()
if let Err(guar) = trait_predicate.error_reported()
{
return guar;
}
@ -2625,9 +2624,6 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
if let Some(e) = self.tainted_by_errors() {
return e;
}
if let Some(e) = self.dcx().has_errors() {
return e;
}
self.emit_inference_failure_err(
obligation.cause.body_id,
@ -2645,10 +2641,6 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
if let Some(e) = self.tainted_by_errors() {
return e;
}
if let Some(e) = self.dcx().has_errors() {
// no need to overload user in such cases
return e;
}
let SubtypePredicate { a_is_expected: _, a, b } = data;
// both must be type variables, or the other would've been instantiated
assert!(a.is_ty_var() && b.is_ty_var());
@ -2728,10 +2720,6 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
if let Some(e) = self.tainted_by_errors() {
return e;
}
if let Some(e) = self.dcx().has_errors() {
// no need to overload user in such cases
return e;
}
struct_span_code_err!(
self.dcx(),
span,