From 9c766db5ff9dad3ca13539c186f40f657380a831 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 24 Nov 2019 14:25:48 +0300 Subject: Remove ids module --- crates/ra_hir/src/ty.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crates/ra_hir/src/ty.rs') diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 95b8df181..309bd2727 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -18,6 +18,7 @@ use std::sync::Arc; use std::{fmt, iter, mem}; use hir_def::{generics::GenericParams, AdtId}; +use ra_db::{impl_intern_key, salsa}; use crate::{ db::HirDatabase, expr::ExprId, util::make_mut_slice, Adt, Crate, DefWithBody, FloatTy, @@ -114,6 +115,13 @@ pub enum TypeCtor { Closure { def: DefWithBody, expr: ExprId }, } +/// This exists just for Chalk, because Chalk just has a single `StructId` where +/// we have different kinds of ADTs, primitive types and special type +/// constructors like tuples and function pointers. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct TypeCtorId(salsa::InternId); +impl_intern_key!(TypeCtorId); + impl TypeCtor { pub fn num_ty_params(self, db: &impl HirDatabase) -> usize { match self { -- cgit v1.2.3