From e11cd8fe35fbb4fcaf7859f4cef2dbd94ff7d230 Mon Sep 17 00:00:00 2001 From: adamrk Date: Wed, 2 Sep 2020 22:33:54 +0200 Subject: Remove exposing unification --- crates/hir_ty/src/db.rs | 3 --- crates/hir_ty/src/infer.rs | 13 ------------- 2 files changed, 16 deletions(-) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/db.rs b/crates/hir_ty/src/db.rs index 57e60c53b..25cf9eb7f 100644 --- a/crates/hir_ty/src/db.rs +++ b/crates/hir_ty/src/db.rs @@ -26,9 +26,6 @@ pub trait HirDatabase: DefDatabase + Upcast { #[salsa::invoke(crate::infer::infer_query)] fn infer_query(&self, def: DefWithBodyId) -> Arc; - #[salsa::invoke(crate::infer::can_unify)] - fn can_unify(&self, def: DefWithBodyId, ty1: Ty, ty2: Ty) -> bool; - #[salsa::invoke(crate::lower::ty_query)] #[salsa::cycle(crate::lower::ty_recover)] fn ty(&self, def: TyDefId) -> Binders; diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs index d461e077b..2db05ae78 100644 --- a/crates/hir_ty/src/infer.rs +++ b/crates/hir_ty/src/infer.rs @@ -78,19 +78,6 @@ pub(crate) fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc bool { - let resolver = def.resolver(db.upcast()); - let mut ctx = InferenceContext::new(db, def, resolver); - - let ty1 = ctx.canonicalizer().canonicalize_ty(ty1).value; - let ty2 = ctx.canonicalizer().canonicalize_ty(ty2).value; - let mut kinds = Vec::from(ty1.kinds.to_vec()); - kinds.extend_from_slice(ty2.kinds.as_ref()); - let tys = crate::Canonical::new((ty1.value, ty2.value), kinds); - - unify(&tys).is_some() -} - #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] enum ExprOrPatId { ExprId(ExprId), -- cgit v1.2.3