aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/db.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-16 09:02:39 +0100
committerGitHub <[email protected]>2020-07-16 09:02:39 +0100
commit6a74a917133a98aac2a35df537b7112279dd7d71 (patch)
tree103618bb65397a0051a92b5fe00329e791ef1803 /crates/ra_hir_ty/src/db.rs
parent6824cf4f8a94dc9d0bd049efcf99e18651c71831 (diff)
parent20770044631fd0c21caa12f9bc87489ea6c848ee (diff)
Merge #5401
5401: Implement Chalk closure support r=matklad a=flodiebold This makes use of Chalk's closure support, which means we can get rid of our last built-in impls and a bunch of other surrounding stuff. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/db.rs')
-rw-r--r--crates/ra_hir_ty/src/db.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_hir_ty/src/db.rs b/crates/ra_hir_ty/src/db.rs
index 84afe0484..608bab1b1 100644
--- a/crates/ra_hir_ty/src/db.rs
+++ b/crates/ra_hir_ty/src/db.rs
@@ -3,8 +3,8 @@
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use hir_def::{ 5use hir_def::{
6 db::DefDatabase, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId, TypeParamId, 6 db::DefDatabase, expr::ExprId, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId,
7 VariantId, 7 TypeParamId, VariantId,
8}; 8};
9use ra_arena::map::ArenaMap; 9use ra_arena::map::ArenaMap;
10use ra_db::{impl_intern_key, salsa, CrateId, Upcast}; 10use ra_db::{impl_intern_key, salsa, CrateId, Upcast};
@@ -12,9 +12,9 @@ use ra_prof::profile;
12 12
13use crate::{ 13use crate::{
14 method_resolution::{InherentImpls, TraitImpls}, 14 method_resolution::{InherentImpls, TraitImpls},
15 traits::{chalk, AssocTyValue, Impl}, 15 traits::chalk,
16 Binders, CallableDef, GenericPredicate, InferenceResult, OpaqueTyId, PolyFnSig, 16 Binders, CallableDef, GenericPredicate, InferenceResult, OpaqueTyId, PolyFnSig,
17 ReturnTypeImplTraits, TraitRef, Ty, TyDefId, TypeCtor, ValueTyDefId, 17 ReturnTypeImplTraits, TraitRef, Ty, TyDefId, ValueTyDefId,
18}; 18};
19use hir_expand::name::Name; 19use hir_expand::name::Name;
20 20
@@ -77,17 +77,13 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
77 77
78 // Interned IDs for Chalk integration 78 // Interned IDs for Chalk integration
79 #[salsa::interned] 79 #[salsa::interned]
80 fn intern_type_ctor(&self, type_ctor: TypeCtor) -> crate::TypeCtorId;
81 #[salsa::interned]
82 fn intern_callable_def(&self, callable_def: CallableDef) -> crate::CallableDefId; 80 fn intern_callable_def(&self, callable_def: CallableDef) -> crate::CallableDefId;
83 #[salsa::interned] 81 #[salsa::interned]
84 fn intern_type_param_id(&self, param_id: TypeParamId) -> GlobalTypeParamId; 82 fn intern_type_param_id(&self, param_id: TypeParamId) -> GlobalTypeParamId;
85 #[salsa::interned] 83 #[salsa::interned]
86 fn intern_impl_trait_id(&self, id: OpaqueTyId) -> InternedOpaqueTyId; 84 fn intern_impl_trait_id(&self, id: OpaqueTyId) -> InternedOpaqueTyId;
87 #[salsa::interned] 85 #[salsa::interned]
88 fn intern_chalk_impl(&self, impl_: Impl) -> crate::traits::GlobalImplId; 86 fn intern_closure(&self, id: (DefWithBodyId, ExprId)) -> ClosureId;
89 #[salsa::interned]
90 fn intern_assoc_ty_value(&self, assoc_ty_value: AssocTyValue) -> crate::traits::AssocTyValueId;
91 87
92 #[salsa::invoke(chalk::associated_ty_data_query)] 88 #[salsa::invoke(chalk::associated_ty_data_query)]
93 fn associated_ty_data(&self, id: chalk::AssocTypeId) -> Arc<chalk::AssociatedTyDatum>; 89 fn associated_ty_data(&self, id: chalk::AssocTypeId) -> Arc<chalk::AssociatedTyDatum>;
@@ -151,3 +147,7 @@ impl_intern_key!(GlobalTypeParamId);
151#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 147#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
152pub struct InternedOpaqueTyId(salsa::InternId); 148pub struct InternedOpaqueTyId(salsa::InternId);
153impl_intern_key!(InternedOpaqueTyId); 149impl_intern_key!(InternedOpaqueTyId);
150
151#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
152pub struct ClosureId(salsa::InternId);
153impl_intern_key!(ClosureId);