summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_infer/src/infer/lattice.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_infer/src/infer/lattice.rs')
-rw-r--r--compiler/rustc_infer/src/infer/lattice.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/rustc_infer/src/infer/lattice.rs b/compiler/rustc_infer/src/infer/lattice.rs
index eba65361a..4dbb4b4d7 100644
--- a/compiler/rustc_infer/src/infer/lattice.rs
+++ b/compiler/rustc_infer/src/infer/lattice.rs
@@ -78,7 +78,7 @@ where
//
// Example: if the LHS is a type variable, and RHS is
// `Box<i32>`, then we current compare `v` to the RHS first,
- // which will instantiate `v` with `Box<i32>`. Then when `v`
+ // which will instantiate `v` with `Box<i32>`. Then when `v`
// is compared to the LHS, we instantiate LHS with `Box<i32>`.
// But if we did in reverse order, we would create a `v <:
// LHS` (or vice versa) constraint and then instantiate
@@ -105,11 +105,13 @@ where
Ok(v)
}
- (&ty::Opaque(a_def_id, _), &ty::Opaque(b_def_id, _)) if a_def_id == b_def_id => {
- infcx.super_combine_tys(this, a, b)
- }
- (&ty::Opaque(did, ..), _) | (_, &ty::Opaque(did, ..))
- if this.define_opaque_types() && did.is_local() =>
+ (
+ &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() && def_id.is_local() =>
{
this.add_obligations(
infcx