// But if we did in reverse order, we would create a `v <:
// LHS` (or vice versa) constraint and then instantiate
// `v`. This would require further processing to achieve same
- // end-result; in partiular, this screws up some of the logic
+ // end-result; in particular, this screws up some of the logic
// in coercion, which expects LUB to figure out that the LHS
// is (e.g.) `Box<i32>`. A more obvious solution might be to
// iterate on the subtype obligations that are returned, but I
(&ty::Opaque(did, ..), _) | (_, &ty::Opaque(did, ..))
if this.define_opaque_types() && did.is_local() =>
{
- this.add_obligations(vec![infcx.opaque_ty_obligation(
- a,
- b,
- this.a_is_expected(),
- this.param_env(),
- this.cause().clone(),
- )]);
+ this.add_obligations(
+ infcx
+ .handle_opaque_type(a, b, this.a_is_expected(), this.cause(), this.param_env())?
+ .obligations,
+ );
Ok(a)
}