From a2783df3f00eb2cc8d6832f44fe8aa7ea3be46c8 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 11 Apr 2020 13:11:33 +0200 Subject: Look up impls by self type This speeds up inference in analysis-stats by ~30% (even more with the recursive solver). --- crates/ra_hir_ty/src/db.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_ty/src/db.rs') 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}; use ra_prof::profile; use crate::{ - method_resolution::CrateImplDefs, + method_resolution::{CrateImplDefs, TyFingerprint}, traits::{chalk, AssocTyValue, Impl}, Binders, CallableDef, GenericPredicate, InferenceResult, PolyFnSig, Substs, TraitRef, Ty, TyDefId, TypeCtor, ValueTyDefId, @@ -65,7 +65,12 @@ pub trait HirDatabase: DefDatabase + Upcast { fn impls_in_crate(&self, krate: CrateId) -> Arc; #[salsa::invoke(crate::traits::impls_for_trait_query)] - fn impls_for_trait(&self, krate: CrateId, trait_: TraitId) -> Arc<[ImplId]>; + fn impls_for_trait( + &self, + krate: CrateId, + trait_: TraitId, + self_ty_fp: Option, + ) -> Arc<[ImplId]>; // Interned IDs for Chalk integration #[salsa::interned] -- cgit v1.2.3