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``
This commit is contained in:
commit
e674b34d56
6 changed files with 4 additions and 74 deletions
|
@ -2544,10 +2544,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
let obligation =
|
let obligation =
|
||||||
Obligation::new(self.tcx, ObligationCause::dummy(), param_env, cleaned_pred);
|
Obligation::new(self.tcx, ObligationCause::dummy(), param_env, cleaned_pred);
|
||||||
|
|
||||||
// We don't use `InferCtxt::predicate_may_hold` because that
|
self.predicate_may_hold(&obligation)
|
||||||
// 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())
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1336,8 +1336,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
obligation.param_env,
|
obligation.param_env,
|
||||||
trait_pred_and_suggested_ty,
|
trait_pred_and_suggested_ty,
|
||||||
);
|
);
|
||||||
let suggested_ty_would_satisfy_obligation =
|
let suggested_ty_would_satisfy_obligation = self
|
||||||
self.predicate_must_hold_modulo_regions(&new_obligation);
|
.evaluate_obligation_no_overflow(&new_obligation)
|
||||||
|
.must_apply_modulo_regions();
|
||||||
if suggested_ty_would_satisfy_obligation {
|
if suggested_ty_would_satisfy_obligation {
|
||||||
let sp = self
|
let sp = self
|
||||||
.tcx
|
.tcx
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
fn f<B>(x: Vec<[[[B; 1]; 1]; 1]>) -> impl PartialEq<B> {
|
|
||||||
//~^ ERROR can't compare `Vec<[[[B; 1]; 1]; 1]>` with `B`
|
|
||||||
x
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {}
|
|
|
@ -1,21 +0,0 @@
|
||||||
error[E0277]: can't compare `Vec<[[[B; 1]; 1]; 1]>` with `B`
|
|
||||||
--> $DIR/predicate_can_apply-hang.rs:1:38
|
|
||||||
|
|
|
||||||
LL | fn f<B>(x: Vec<[[[B; 1]; 1]; 1]>) -> impl PartialEq<B> {
|
|
||||||
| ^^^^^^^^^^^^^^^^^ no implementation for `Vec<[[[B; 1]; 1]; 1]> == B`
|
|
||||||
LL |
|
|
||||||
LL | x
|
|
||||||
| - return type was inferred to be `Vec<[[[B; 1]; 1]; 1]>` here
|
|
||||||
|
|
|
||||||
= help: the trait `PartialEq<B>` is not implemented for `Vec<[[[B; 1]; 1]; 1]>`
|
|
||||||
= help: the following other types implement trait `PartialEq<Rhs>`:
|
|
||||||
<Vec<T, A1> as PartialEq<Vec<U, A2>>>
|
|
||||||
<Vec<T, A> as PartialEq<&[U; N]>>
|
|
||||||
<Vec<T, A> as PartialEq<&[U]>>
|
|
||||||
<Vec<T, A> as PartialEq<&mut [U]>>
|
|
||||||
<Vec<T, A> as PartialEq<[U; N]>>
|
|
||||||
<Vec<T, A> as PartialEq<[U]>>
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0277`.
|
|
|
@ -1,19 +0,0 @@
|
||||||
// normalize-stderr-test "the requirement `.*`" -> "the requirement `...`"
|
|
||||||
// normalize-stderr-test "required for `.*` to implement `.*`" -> "required for `...` to implement `...`"
|
|
||||||
// normalize-stderr-test: ".*the full type name has been written to.*\n" -> ""
|
|
||||||
|
|
||||||
// Currently this fatally aborts instead of hanging.
|
|
||||||
// Make sure at least that this doesn't turn into a hang.
|
|
||||||
|
|
||||||
fn f() {
|
|
||||||
foo::<_>();
|
|
||||||
//~^ ERROR overflow evaluating the requirement
|
|
||||||
}
|
|
||||||
|
|
||||||
fn foo<B>()
|
|
||||||
where
|
|
||||||
Vec<[[[B; 1]; 1]; 1]>: PartialEq<B>,
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {}
|
|
|
@ -1,22 +0,0 @@
|
||||||
error[E0275]: overflow evaluating the requirement `...`
|
|
||||||
--> $DIR/hang-in-overflow.rs:9:5
|
|
||||||
|
|
|
||||||
LL | foo::<_>();
|
|
||||||
| ^^^^^^^^
|
|
||||||
|
|
|
||||||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hang_in_overflow`)
|
|
||||||
= note: required for `...` to implement `...`
|
|
||||||
= note: 127 redundant requirements hidden
|
|
||||||
= note: required for `...` to implement `...`
|
|
||||||
note: required by a bound in `foo`
|
|
||||||
--> $DIR/hang-in-overflow.rs:15:28
|
|
||||||
|
|
|
||||||
LL | fn foo<B>()
|
|
||||||
| --- required by a bound in this
|
|
||||||
LL | where
|
|
||||||
LL | Vec<[[[B; 1]; 1]; 1]>: PartialEq<B>,
|
|
||||||
| ^^^^^^^^^^^^ required by this bound in `foo`
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0275`.
|
|
Loading…
Add table
Add a link
Reference in a new issue