about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/infer/lattice.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-05-09 18:56:43 +0000
committerMichael Goulet <michael@errs.io>2023-05-25 03:19:15 +0000
commit4d80b8090c30980c03ff4bb6f47a7560ffaa68a4 (patch)
treed45cf4788222a3542ea503f8083f516ecbb04855 /compiler/rustc_infer/src/infer/lattice.rs
parent7664dfe4331265d0b2b1ffb89c92d443886bec0b (diff)
downloadrust-4d80b8090c30980c03ff4bb6f47a7560ffaa68a4.tar.gz
rust-4d80b8090c30980c03ff4bb6f47a7560ffaa68a4.zip
Pull out logic from #111131, plus some new logic in EvalCtxt::normalize_opaque_type
Co-authored-by: lcnr <rust@lcnr.de>
Diffstat (limited to 'compiler/rustc_infer/src/infer/lattice.rs')
-rw-r--r--compiler/rustc_infer/src/infer/lattice.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_infer/src/infer/lattice.rs b/compiler/rustc_infer/src/infer/lattice.rs
index 7f4c141b97a..7190d33d299 100644
--- a/compiler/rustc_infer/src/infer/lattice.rs
+++ b/compiler/rustc_infer/src/infer/lattice.rs
@@ -108,9 +108,12 @@ where
             &ty::Alias(ty::Opaque, ty::AliasTy { def_id: a_def_id, .. }),
             &ty::Alias(ty::Opaque, ty::AliasTy { def_id: b_def_id, .. }),
         ) if a_def_id == b_def_id => infcx.super_combine_tys(this, a, b),
+
         (&ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }), _)
         | (_, &ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }))
-            if this.define_opaque_types() == DefineOpaqueTypes::Yes && def_id.is_local() =>
+            if this.define_opaque_types() == DefineOpaqueTypes::Yes
+                && def_id.is_local()
+                && !this.tcx().trait_solver_next() =>
         {
             this.register_obligations(
                 infcx