Don't call diagnostic_hir_wf_check query if we have infer variables

This commit is contained in:
Michael Goulet 2022-12-05 03:17:53 +00:00
parent 53e4b9dd74
commit 64ad337a3b
3 changed files with 51 additions and 0 deletions

View file

@ -555,6 +555,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