From b598ab8be46b50d5f407c3858c7b2c788328edc7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 16 Jul 2020 13:13:17 +0200 Subject: Rename CallableDefId -> InternedCallabelDefid --- crates/ra_hir_ty/src/lib.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'crates/ra_hir_ty/src/lib.rs') diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index 9f034eca5..72b089604 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs @@ -33,7 +33,7 @@ use hir_def::{ TypeParamId, }; use itertools::Itertools; -use ra_db::{impl_intern_key, salsa, CrateId}; +use ra_db::{salsa, CrateId}; use crate::{ db::HirDatabase, @@ -140,12 +140,6 @@ pub enum TypeCtor { Closure { def: DefWithBodyId, expr: ExprId }, } -/// This exists just for Chalk, because Chalk just has a single `FnDefId` where -/// we have different IDs for struct and enum variant constructors. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)] -pub struct CallableDefId(salsa::InternId); -impl_intern_key!(CallableDefId); - impl TypeCtor { pub fn num_ty_params(self, db: &dyn HirDatabase) -> usize { match self { -- cgit v1.2.3 From b5ce84b17023d27f4e96ec7911aca712db0e000b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 16 Jul 2020 13:15:00 +0200 Subject: Align CallableDefId naming with other ids --- crates/ra_hir_ty/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir_ty/src/lib.rs') diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index 72b089604..0ef5ca78f 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs @@ -44,7 +44,7 @@ use crate::{ pub use autoderef::autoderef; pub use infer::{InferTy, InferenceResult}; -pub use lower::CallableDef; +pub use lower::CallableDefId; pub use lower::{ associated_type_shorthand_candidates, callable_item_sig, ImplTraitLoweringMode, TyDefId, TyLoweringContext, ValueTyDefId, @@ -102,7 +102,7 @@ pub enum TypeCtor { /// fn foo() -> i32 { 1 } /// let bar = foo; // bar: fn() -> i32 {foo} /// ``` - FnDef(CallableDef), + FnDef(CallableDefId), /// A pointer to a function. Written as `fn() -> i32`. /// @@ -767,7 +767,7 @@ impl Ty { } } - pub fn as_callable(&self) -> Option<(CallableDef, &Substs)> { + pub fn as_callable(&self) -> Option<(CallableDefId, &Substs)> { match self { Ty::Apply(ApplicationTy { ctor: TypeCtor::FnDef(callable_def), parameters }) => { Some((*callable_def, parameters)) -- cgit v1.2.3