From 6777a4975d6a88928fda3e3b3f0bb05d98c61060 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 7 Apr 2021 20:40:01 +0200 Subject: Move hir_trait_id to extension trait --- crates/hir_ty/src/lib.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'crates/hir_ty/src/lib.rs') diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 84645c435..7538e0874 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs @@ -41,7 +41,7 @@ use crate::{db::HirDatabase, display::HirDisplay, utils::generics}; pub use autoderef::autoderef; pub use builder::TyBuilder; -pub use chalk_ext::{ProjectionTyExt, TyExt}; +pub use chalk_ext::*; pub use infer::{could_unify, InferenceResult}; pub use lower::{ associated_type_shorthand_candidates, callable_item_sig, CallableDefId, ImplTraitLoweringMode, @@ -107,12 +107,6 @@ pub fn make_only_type_binders(num_vars: usize, value: T) -> Binders { ) } -impl TraitRef { - pub fn hir_trait_id(&self) -> TraitId { - from_chalk_trait_id(self.trait_id) - } -} - impl Canonical { pub fn new(value: T, kinds: impl IntoIterator) -> Self { let kinds = kinds.into_iter().map(|tk| { -- cgit v1.2.3 From d1b645d2360fb6e74aaa774ff713af02f685a110 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 7 Apr 2021 20:47:04 +0200 Subject: Make Canonical::new a free-standing function --- crates/hir_ty/src/lib.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'crates/hir_ty/src/lib.rs') diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 7538e0874..915b1028f 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs @@ -107,16 +107,18 @@ pub fn make_only_type_binders(num_vars: usize, value: T) -> Binders { ) } -impl Canonical { - pub fn new(value: T, kinds: impl IntoIterator) -> Self { - let kinds = kinds.into_iter().map(|tk| { - chalk_ir::CanonicalVarKind::new( - chalk_ir::VariableKind::Ty(tk), - chalk_ir::UniverseIndex::ROOT, - ) - }); - Self { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) } - } +// FIXME: get rid of this +pub fn make_canonical( + value: T, + kinds: impl IntoIterator, +) -> Canonical { + let kinds = kinds.into_iter().map(|tk| { + chalk_ir::CanonicalVarKind::new( + chalk_ir::VariableKind::Ty(tk), + chalk_ir::UniverseIndex::ROOT, + ) + }); + Canonical { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) } } /// A function signature as seen by type inference: Several parameter types and -- cgit v1.2.3