From bfbc210bc1216b79e355eb70449caf08dc67d5ad Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 22 May 2020 18:15:53 +0200 Subject: Use Chalk's built-in representation of function item types --- crates/ra_hir_ty/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (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 e91c9be04..93cb45a64 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs @@ -159,6 +159,12 @@ pub enum TypeCtor { pub struct TypeCtorId(salsa::InternId); impl_intern_key!(TypeCtorId); +/// 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