Use Chalk's built-in representation of function item types

This commit is contained in:
Florian Diebold
2020-05-22 18:15:53 +02:00
committed by Florian Diebold
parent d4daca9f02
commit bfbc210bc1
7 changed files with 128 additions and 10 deletions

View File

@@ -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 {