1
Fork 0

Do not need to account for overflow in predicate_can_apply

This commit is contained in:
Michael Goulet 2022-11-11 03:19:02 +00:00
parent 604d52108e
commit cbe9328018
3 changed files with 31 additions and 1 deletions

View file

@ -2544,7 +2544,10 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
let obligation =
Obligation::new(self.tcx, ObligationCause::dummy(), param_env, cleaned_pred);
self.predicate_may_hold(&obligation)
// We don't use `InferCtxt::predicate_may_hold` because that
// will re-run predicates that overflow locally, which ends up
// taking a really long time to compute.
self.evaluate_obligation(&obligation).map_or(false, |eval| eval.may_apply())
})
}