Skip to content

Commit e674b34

Browse files
authored
Rollup merge of #104959 - compiler-errors:revert-104269, r=lcnr
Revert #104269 (to avoid spurious hang/test failure in CI) Causes hangs/memory overflows in the test suite apparently 😢 Reopens #104225 Fixes #104957 r? ``@lcnr``
2 parents c81605c + 4149923 commit e674b34

File tree

6 files changed

+4
-74
lines changed

6 files changed

+4
-74
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -2544,10 +2544,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
25442544
let obligation =
25452545
Obligation::new(self.tcx, ObligationCause::dummy(), param_env, cleaned_pred);
25462546

2547-
// We don't use `InferCtxt::predicate_may_hold` because that
2548-
// will re-run predicates that overflow locally, which ends up
2549-
// taking a really long time to compute.
2550-
self.evaluate_obligation(&obligation).map_or(false, |eval| eval.may_apply())
2547+
self.predicate_may_hold(&obligation)
25512548
})
25522549
}
25532550

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1336,8 +1336,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
13361336
obligation.param_env,
13371337
trait_pred_and_suggested_ty,
13381338
);
1339-
let suggested_ty_would_satisfy_obligation =
1340-
self.predicate_must_hold_modulo_regions(&new_obligation);
1339+
let suggested_ty_would_satisfy_obligation = self
1340+
.evaluate_obligation_no_overflow(&new_obligation)
1341+
.must_apply_modulo_regions();
13411342
if suggested_ty_would_satisfy_obligation {
13421343
let sp = self
13431344
.tcx

src/test/ui/traits/predicate_can_apply-hang.rs

-6
This file was deleted.

src/test/ui/traits/predicate_can_apply-hang.stderr

-21
This file was deleted.

src/test/ui/typeck/hang-in-overflow.rs

-19
This file was deleted.

src/test/ui/typeck/hang-in-overflow.stderr

-22
This file was deleted.

0 commit comments

Comments
 (0)