1
Fork 0

Allow constraining opaque types during subtyping in the trait system

This commit is contained in:
Oli Scherer 2024-05-27 11:49:05 +00:00
parent 9889a6f5d3
commit ba4510ece8
5 changed files with 37 additions and 87 deletions

View file

@ -878,9 +878,9 @@ impl<'tcx> InferCtxt<'tcx> {
self.enter_forall(predicate, |ty::SubtypePredicate { a_is_expected, a, b }| {
if a_is_expected {
Ok(self.at(cause, param_env).sub(DefineOpaqueTypes::No, a, b))
Ok(self.at(cause, param_env).sub(DefineOpaqueTypes::Yes, a, b))
} else {
Ok(self.at(cause, param_env).sup(DefineOpaqueTypes::No, b, a))
Ok(self.at(cause, param_env).sup(DefineOpaqueTypes::Yes, b, a))
}
})
}