]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_infer/src/infer/lattice.rs
Rollup merge of #95344 - jyn514:better-debug-output, r=camelid
[rust.git] / compiler / rustc_infer / src / infer / lattice.rs
index f4c749492d3bc3e7c02a0da83f7893f9d758cdab..1e3293efad649be1d3e490353ed7b37fe19d979a 100644 (file)
@@ -83,7 +83,7 @@ pub fn super_lattice_tys<'a, 'tcx: 'a, L>(
         // 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
@@ -111,13 +111,11 @@ pub fn super_lattice_tys<'a, 'tcx: 'a, L>(
         (&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)
         }