1
Fork 0

Rollup merge of #119818 - oli-obk:even_more_follow_up_errors3, r=compiler-errors

Silence some follow-up errors [3/x]

this is one piece of the requested cleanups from https://github.com/rust-lang/rust/pull/117449

Keep error types around, even in obligations.

These help silence follow-up errors, as we now figure out that some types (most notably inference variables) are equal to an error type.

But it also allows figuring out more types in the presence of errors, possibly causing more errors.
This commit is contained in:
Matthias Krüger 2024-01-15 08:44:46 +01:00 committed by GitHub
commit 73256c68b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 22 additions and 55 deletions

View file

@ -631,13 +631,6 @@ impl<'tcx> InferCtxt<'tcx> {
ct_op: |ct| ct,
});
if let ty::ClauseKind::Projection(projection) = predicate.kind().skip_binder() {
if projection.term.references_error() {
// No point on adding any obligations since there's a type error involved.
obligations.clear();
return;
}
}
// Require that the predicate holds for the concrete type.
debug!(?predicate);
obligations.push(traits::Obligation::new(