Skip to content

Commit

Permalink
Rollup merge of rust-lang#104959 - compiler-errors:revert-104269, r=lcnr
Browse files Browse the repository at this point in the history
Revert rust-lang#104269 (to avoid spurious hang/test failure in CI)

Causes hangs/memory overflows in the test suite apparently 😢

Reopens rust-lang#104225
Fixes rust-lang#104957
r? ``@lcnr``
  • Loading branch information
matthiaskrgr authored Nov 29, 2022
2 parents c81605c + 4149923 commit e674b34
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2544,10 +2544,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
let obligation =
Obligation::new(self.tcx, ObligationCause::dummy(), param_env, cleaned_pred);

// 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())
self.predicate_may_hold(&obligation)
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
obligation.param_env,
trait_pred_and_suggested_ty,
);
let suggested_ty_would_satisfy_obligation =
self.predicate_must_hold_modulo_regions(&new_obligation);
let suggested_ty_would_satisfy_obligation = self
.evaluate_obligation_no_overflow(&new_obligation)
.must_apply_modulo_regions();
if suggested_ty_would_satisfy_obligation {
let sp = self
.tcx
Expand Down
6 changes: 0 additions & 6 deletions src/test/ui/traits/predicate_can_apply-hang.rs

This file was deleted.

21 changes: 0 additions & 21 deletions src/test/ui/traits/predicate_can_apply-hang.stderr

This file was deleted.

19 changes: 0 additions & 19 deletions src/test/ui/typeck/hang-in-overflow.rs

This file was deleted.

22 changes: 0 additions & 22 deletions src/test/ui/typeck/hang-in-overflow.stderr

This file was deleted.

0 comments on commit e674b34

Please sign in to comment.