aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs8
1 files changed, 8 insertions, 0 deletions
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;
18use std::{fmt, iter, mem}; 18use std::{fmt, iter, mem};
19 19
20use hir_def::{generics::GenericParams, AdtId}; 20use hir_def::{generics::GenericParams, AdtId};
21use ra_db::{impl_intern_key, salsa};
21 22
22use crate::{ 23use crate::{
23 db::HirDatabase, expr::ExprId, util::make_mut_slice, Adt, Crate, DefWithBody, FloatTy, 24 db::HirDatabase, expr::ExprId, util::make_mut_slice, Adt, Crate, DefWithBody, FloatTy,
@@ -114,6 +115,13 @@ pub enum TypeCtor {
114 Closure { def: DefWithBody, expr: ExprId }, 115 Closure { def: DefWithBody, expr: ExprId },
115} 116}
116 117
118/// This exists just for Chalk, because Chalk just has a single `StructId` where
119/// we have different kinds of ADTs, primitive types and special type
120/// constructors like tuples and function pointers.
121#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
122pub struct TypeCtorId(salsa::InternId);
123impl_intern_key!(TypeCtorId);
124
117impl TypeCtor { 125impl TypeCtor {
118 pub fn num_ty_params(self, db: &impl HirDatabase) -> usize { 126 pub fn num_ty_params(self, db: &impl HirDatabase) -> usize {
119 match self { 127 match self {