1
Fork 0

Make TraitEngine::new use the right solver, add compare mode

This commit is contained in:
Michael Goulet 2023-05-31 01:21:38 +00:00
parent b637048a89
commit 3d4da98273
8 changed files with 49 additions and 32 deletions

View file

@ -231,17 +231,15 @@ impl<'tcx> InferCtxt<'tcx> {
{
let (a, b) = if relation.a_is_expected() { (a, b) } else { (b, a) };
relation.register_predicates([ty::Binder::dummy(
if self.next_trait_solver() {
ty::PredicateKind::AliasRelate(
a.into(),
b.into(),
ty::AliasRelationDirection::Equate,
)
} else {
ty::PredicateKind::ConstEquate(a, b)
},
)]);
relation.register_predicates([ty::Binder::dummy(if self.next_trait_solver() {
ty::PredicateKind::AliasRelate(
a.into(),
b.into(),
ty::AliasRelationDirection::Equate,
)
} else {
ty::PredicateKind::ConstEquate(a, b)
})]);
return Ok(b);
}