aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/db.rs
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-04-14 17:11:17 +0100
committerKirill Bulatov <[email protected]>2021-04-14 17:11:17 +0100
commitaf8a6049a50809b0f375ec66d1636a5703c83568 (patch)
tree10d0173b20dd96e0884d677181139e651b511f3f /crates/hir_ty/src/db.rs
parent678af4106504913ea04672e29f452861d97fae18 (diff)
Profile trait solving for all invocations
Diffstat (limited to 'crates/hir_ty/src/db.rs')
-rw-r--r--crates/hir_ty/src/db.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/crates/hir_ty/src/db.rs b/crates/hir_ty/src/db.rs
index 1690926ad..cf67d4266 100644
--- a/crates/hir_ty/src/db.rs
+++ b/crates/hir_ty/src/db.rs
@@ -128,13 +128,21 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
128 id: chalk_db::AssociatedTyValueId, 128 id: chalk_db::AssociatedTyValueId,
129 ) -> Arc<chalk_db::AssociatedTyValue>; 129 ) -> Arc<chalk_db::AssociatedTyValue>;
130 130
131 #[salsa::invoke(crate::traits::trait_solve_query)] 131 #[salsa::invoke(trait_solve_wait)]
132 #[salsa::transparent]
132 fn trait_solve( 133 fn trait_solve(
133 &self, 134 &self,
134 krate: CrateId, 135 krate: CrateId,
135 goal: crate::Canonical<crate::InEnvironment<crate::DomainGoal>>, 136 goal: crate::Canonical<crate::InEnvironment<crate::DomainGoal>>,
136 ) -> Option<crate::Solution>; 137 ) -> Option<crate::Solution>;
137 138
139 #[salsa::invoke(crate::traits::trait_solve_query)]
140 fn trait_solve_query(
141 &self,
142 krate: CrateId,
143 goal: crate::Canonical<crate::InEnvironment<crate::DomainGoal>>,
144 ) -> Option<crate::Solution>;
145
138 #[salsa::invoke(chalk_db::program_clauses_for_chalk_env_query)] 146 #[salsa::invoke(chalk_db::program_clauses_for_chalk_env_query)]
139 fn program_clauses_for_chalk_env( 147 fn program_clauses_for_chalk_env(
140 &self, 148 &self,
@@ -156,6 +164,15 @@ fn infer_wait(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult>
156 db.infer_query(def) 164 db.infer_query(def)
157} 165}
158 166
167fn trait_solve_wait(
168 db: &dyn HirDatabase,
169 krate: CrateId,
170 goal: crate::Canonical<crate::InEnvironment<crate::DomainGoal>>,
171) -> Option<crate::Solution> {
172 let _p = profile::span("trait_solve::wait");
173 db.trait_solve_query(krate, goal)
174}
175
159#[test] 176#[test]
160fn hir_database_is_object_safe() { 177fn hir_database_is_object_safe() {
161 fn _assert_object_safe(_: &dyn HirDatabase) {} 178 fn _assert_object_safe(_: &dyn HirDatabase) {}