Use DefineOpaqueTypes::Yes where the new solver is unconditionally used already
This commit is contained in:
@@ -720,7 +720,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
) -> Result<(), NoSolution> {
|
||||
self.infcx
|
||||
.at(&ObligationCause::dummy(), param_env)
|
||||
.eq(DefineOpaqueTypes::No, lhs, rhs)
|
||||
// New solver ignores DefineOpaqueTypes, so choose Yes for consistency
|
||||
.eq(DefineOpaqueTypes::Yes, lhs, rhs)
|
||||
.map(|InferOk { value: (), obligations }| {
|
||||
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
|
||||
})
|
||||
@@ -759,7 +760,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
) -> Result<(), NoSolution> {
|
||||
self.infcx
|
||||
.at(&ObligationCause::dummy(), param_env)
|
||||
.sub(DefineOpaqueTypes::No, sub, sup)
|
||||
// New solver ignores DefineOpaqueTypes, so choose Yes for consistency
|
||||
.sub(DefineOpaqueTypes::Yes, sub, sup)
|
||||
.map(|InferOk { value: (), obligations }| {
|
||||
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
|
||||
})
|
||||
@@ -779,7 +781,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
) -> Result<(), NoSolution> {
|
||||
self.infcx
|
||||
.at(&ObligationCause::dummy(), param_env)
|
||||
.relate(DefineOpaqueTypes::No, lhs, variance, rhs)
|
||||
// New solver ignores DefineOpaqueTypes, so choose Yes for consistency
|
||||
.relate(DefineOpaqueTypes::Yes, lhs, variance, rhs)
|
||||
.map(|InferOk { value: (), obligations }| {
|
||||
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
|
||||
})
|
||||
@@ -803,7 +806,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
) -> Result<Vec<Goal<'tcx, ty::Predicate<'tcx>>>, NoSolution> {
|
||||
self.infcx
|
||||
.at(&ObligationCause::dummy(), param_env)
|
||||
.eq(DefineOpaqueTypes::No, lhs, rhs)
|
||||
// New solver ignores DefineOpaqueTypes, so choose Yes for consistency
|
||||
.eq(DefineOpaqueTypes::Yes, lhs, rhs)
|
||||
.map(|InferOk { value: (), obligations }| {
|
||||
obligations.into_iter().map(|o| o.into()).collect()
|
||||
})
|
||||
|
||||
@@ -182,7 +182,8 @@ fn rematch_impl<'tcx>(
|
||||
|
||||
let mut nested = infcx
|
||||
.at(&ObligationCause::dummy(), goal.param_env)
|
||||
.eq(DefineOpaqueTypes::No, goal.predicate.trait_ref, impl_trait_ref)
|
||||
// New solver ignores DefineOpaqueTypes, so choose Yes for consistency
|
||||
.eq(DefineOpaqueTypes::Yes, goal.predicate.trait_ref, impl_trait_ref)
|
||||
.map_err(|_| SelectionError::Unimplemented)?
|
||||
.into_obligations();
|
||||
|
||||
@@ -257,7 +258,8 @@ fn rematch_unsize<'tcx>(
|
||||
nested.extend(
|
||||
infcx
|
||||
.at(&ObligationCause::dummy(), goal.param_env)
|
||||
.eq(DefineOpaqueTypes::No, a_elem_ty, b_elem_ty)
|
||||
// New solver ignores DefineOpaqueTypes, so choose Yes for consistency
|
||||
.eq(DefineOpaqueTypes::Yes, a_elem_ty, b_elem_ty)
|
||||
.expect("expected rematch to succeed")
|
||||
.into_obligations(),
|
||||
);
|
||||
@@ -300,7 +302,8 @@ fn rematch_unsize<'tcx>(
|
||||
nested.extend(
|
||||
infcx
|
||||
.at(&ObligationCause::dummy(), goal.param_env)
|
||||
.eq(DefineOpaqueTypes::No, unsized_a_ty, b_ty)
|
||||
// New solver ignores DefineOpaqueTypes, so choose Yes for consistency
|
||||
.eq(DefineOpaqueTypes::Yes, unsized_a_ty, b_ty)
|
||||
.expect("expected rematch to succeed")
|
||||
.into_obligations(),
|
||||
);
|
||||
@@ -329,7 +332,8 @@ fn rematch_unsize<'tcx>(
|
||||
nested.extend(
|
||||
infcx
|
||||
.at(&ObligationCause::dummy(), goal.param_env)
|
||||
.eq(DefineOpaqueTypes::No, unsized_a_ty, b_ty)
|
||||
// New solver ignores DefineOpaqueTypes, so choose Yes for consistency
|
||||
.eq(DefineOpaqueTypes::Yes, unsized_a_ty, b_ty)
|
||||
.expect("expected rematch to succeed")
|
||||
.into_obligations(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user