aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/db.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2020-04-11 12:11:33 +0100
committerFlorian Diebold <[email protected]>2020-04-11 17:04:09 +0100
commita2783df3f00eb2cc8d6832f44fe8aa7ea3be46c8 (patch)
tree168946c8e358b8b85388ed3e75c82b682888a9cd /crates/ra_hir_ty/src/db.rs
parent8bd14a34834919f2e8f329ef1eaf0b15ad4d9680 (diff)
Look up impls by self type
This speeds up inference in analysis-stats by ~30% (even more with the recursive solver).
Diffstat (limited to 'crates/ra_hir_ty/src/db.rs')
-rw-r--r--crates/ra_hir_ty/src/db.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/db.rs b/crates/ra_hir_ty/src/db.rs
index 1462b053f..33da16b48 100644
--- a/crates/ra_hir_ty/src/db.rs
+++ b/crates/ra_hir_ty/src/db.rs
@@ -11,7 +11,7 @@ use ra_db::{impl_intern_key, salsa, CrateId, Upcast};
11use ra_prof::profile; 11use ra_prof::profile;
12 12
13use crate::{ 13use crate::{
14 method_resolution::CrateImplDefs, 14 method_resolution::{CrateImplDefs, TyFingerprint},
15 traits::{chalk, AssocTyValue, Impl}, 15 traits::{chalk, AssocTyValue, Impl},
16 Binders, CallableDef, GenericPredicate, InferenceResult, PolyFnSig, Substs, TraitRef, Ty, 16 Binders, CallableDef, GenericPredicate, InferenceResult, PolyFnSig, Substs, TraitRef, Ty,
17 TyDefId, TypeCtor, ValueTyDefId, 17 TyDefId, TypeCtor, ValueTyDefId,
@@ -65,7 +65,12 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
65 fn impls_in_crate(&self, krate: CrateId) -> Arc<CrateImplDefs>; 65 fn impls_in_crate(&self, krate: CrateId) -> Arc<CrateImplDefs>;
66 66
67 #[salsa::invoke(crate::traits::impls_for_trait_query)] 67 #[salsa::invoke(crate::traits::impls_for_trait_query)]
68 fn impls_for_trait(&self, krate: CrateId, trait_: TraitId) -> Arc<[ImplId]>; 68 fn impls_for_trait(
69 &self,
70 krate: CrateId,
71 trait_: TraitId,
72 self_ty_fp: Option<TyFingerprint>,
73 ) -> Arc<[ImplId]>;
69 74
70 // Interned IDs for Chalk integration 75 // Interned IDs for Chalk integration
71 #[salsa::interned] 76 #[salsa::interned]