about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/infer/lattice.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-02-11 07:18:06 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-02-11 07:18:06 +0000
commitd54195db22421c51fd14560aba3bbf9b79a52677 (patch)
treedbca79885fa7302801114ff50a777d192628d68b /compiler/rustc_infer/src/infer/lattice.rs
parent2d8b8f359312210e34b251906179484ffc7287c6 (diff)
downloadrust-d54195db22421c51fd14560aba3bbf9b79a52677.tar.gz
rust-d54195db22421c51fd14560aba3bbf9b79a52677.zip
Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing
changes made to 734368a200904ef9c21db86c595dc04263c87be0.
Diffstat (limited to 'compiler/rustc_infer/src/infer/lattice.rs')
-rw-r--r--compiler/rustc_infer/src/infer/lattice.rs27
1 files changed, 2 insertions, 25 deletions
diff --git a/compiler/rustc_infer/src/infer/lattice.rs b/compiler/rustc_infer/src/infer/lattice.rs
index 6bda44f0ef2..c47d4769637 100644
--- a/compiler/rustc_infer/src/infer/lattice.rs
+++ b/compiler/rustc_infer/src/infer/lattice.rs
@@ -22,7 +22,7 @@
 use super::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use super::InferCtxt;
 
-use crate::traits::{ObligationCause, PredicateObligation};
+use crate::traits::ObligationCause;
 use rustc_middle::ty::relate::{RelateResult, TypeRelation};
 use rustc_middle::ty::TyVar;
 use rustc_middle::ty::{self, Ty};
@@ -32,10 +32,6 @@ pub trait LatticeDir<'f, 'tcx>: TypeRelation<'tcx> {
 
     fn cause(&self) -> &ObligationCause<'tcx>;
 
-    fn add_obligations(&mut self, obligations: Vec<PredicateObligation<'tcx>>);
-
-    fn define_opaque_types(&self) -> bool;
-
     // Relates the type `v` to `a` and `b` such that `v` represents
     // the LUB/GLB of `a` and `b` as appropriate.
     //
@@ -45,7 +41,6 @@ pub trait LatticeDir<'f, 'tcx>: TypeRelation<'tcx> {
     fn relate_bound(&mut self, v: Ty<'tcx>, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, ()>;
 }
 
-#[instrument(skip(this), level = "debug")]
 pub fn super_lattice_tys<'a, 'tcx: 'a, L>(
     this: &mut L,
     a: Ty<'tcx>,
@@ -54,17 +49,15 @@ pub fn super_lattice_tys<'a, 'tcx: 'a, L>(
 where
     L: LatticeDir<'a, 'tcx>,
 {
-    debug!("{}", this.tag());
+    debug!("{}.lattice_tys({:?}, {:?})", this.tag(), a, b);
 
     if a == b {
         return Ok(a);
     }
 
     let infcx = this.infcx();
-
     let a = infcx.inner.borrow_mut().type_variables().replace_if_possible(a);
     let b = infcx.inner.borrow_mut().type_variables().replace_if_possible(b);
-
     match (a.kind(), b.kind()) {
         // If one side is known to be a variable and one is not,
         // create a variable (`v`) to represent the LUB. Make sure to
@@ -101,22 +94,6 @@ 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() =>
-        {
-            this.add_obligations(vec![infcx.opaque_ty_obligation(
-                a,
-                b,
-                this.a_is_expected(),
-                this.param_env(),
-                this.cause().clone(),
-            )]);
-            Ok(a)
-        }
-
         _ => infcx.super_combine_tys(this, a, b),
     }
 }