Rollup merge of #112322 - compiler-errors:no-IMPLIED_BOUNDS_ENTAILMENT-if-errs, r=eholk

Don't mention `IMPLIED_BOUNDS_ENTAILMENT` if signatures reference error

Fixes #112321
This commit is contained in:
Matthias Krüger 2023-06-05 23:48:00 +02:00 committed by GitHub
commit dcdd867a52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 1 deletions

View file

@ -302,7 +302,7 @@ fn compare_method_predicate_entailment<'tcx>(
return Err(emitted);
}
if check_implied_wf == CheckImpliedWfMode::Check {
if check_implied_wf == CheckImpliedWfMode::Check && !(impl_sig, trait_sig).references_error() {
// We need to check that the impl's args are well-formed given
// the hybrid param-env (impl + trait method where-clauses).
ocx.register_obligation(traits::Obligation::new(