1
Fork 0

Rollup merge of #105283 - compiler-errors:ty-var-in-hir-wfcheck, r=nagisa

Don't call `diagnostic_hir_wf_check` query if we have infer variables

Fixes #105260
This commit is contained in:
Matthias Krüger 2022-12-11 23:36:45 +01:00 committed by GitHub
commit aa7b5b32e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 0 deletions

View file

@ -597,6 +597,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
// can get a better error message by performing HIR-based well-formedness checking.
if let ObligationCauseCode::WellFormed(Some(wf_loc)) =
root_obligation.cause.code().peel_derives()
&& !obligation.predicate.has_non_region_infer()
{
if let Some(cause) = self
.tcx