aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/traits.rs')
-rw-r--r--crates/hir_ty/src/traits.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/hir_ty/src/traits.rs b/crates/hir_ty/src/traits.rs
index 255323717..6a012cd6a 100644
--- a/crates/hir_ty/src/traits.rs
+++ b/crates/hir_ty/src/traits.rs
@@ -3,7 +3,7 @@ use std::sync::Arc;
3 3
4use base_db::CrateId; 4use base_db::CrateId;
5use chalk_ir::cast::Cast; 5use chalk_ir::cast::Cast;
6use chalk_solve::Solver; 6use chalk_solve::{logging_db::LoggingRustIrDatabase, Solver};
7use hir_def::{lang_item::LangItemTarget, TraitId}; 7use hir_def::{lang_item::LangItemTarget, TraitId};
8 8
9use crate::{db::HirDatabase, DebruijnIndex, Substs}; 9use crate::{db::HirDatabase, DebruijnIndex, Substs};
@@ -152,6 +152,9 @@ fn solve(
152 goal: &chalk_ir::UCanonical<chalk_ir::InEnvironment<chalk_ir::Goal<Interner>>>, 152 goal: &chalk_ir::UCanonical<chalk_ir::InEnvironment<chalk_ir::Goal<Interner>>>,
153) -> Option<chalk_solve::Solution<Interner>> { 153) -> Option<chalk_solve::Solution<Interner>> {
154 let context = ChalkContext { db, krate }; 154 let context = ChalkContext { db, krate };
155
156 let logging_db = LoggingRustIrDatabase::new(context);
157
155 log::debug!("solve goal: {:?}", goal); 158 log::debug!("solve goal: {:?}", goal);
156 let mut solver = create_chalk_solver(); 159 let mut solver = create_chalk_solver();
157 160
@@ -167,7 +170,7 @@ fn solve(
167 remaining > 0 170 remaining > 0
168 }; 171 };
169 let mut solve = || { 172 let mut solve = || {
170 let solution = solver.solve_limited(&context, goal, should_continue); 173 let solution = solver.solve_limited(&logging_db, goal, should_continue);
171 log::debug!("solve({:?}) => {:?}", goal, solution); 174 log::debug!("solve({:?}) => {:?}", goal, solution);
172 solution 175 solution
173 }; 176 };
@@ -176,6 +179,8 @@ fn solve(
176 let solution = 179 let solution =
177 if is_chalk_debug() { chalk::tls::set_current_program(db, solve) } else { solve() }; 180 if is_chalk_debug() { chalk::tls::set_current_program(db, solve) } else { solve() };
178 181
182 log::debug!("chalk program:\n{}", logging_db);
183
179 solution 184 solution
180} 185}
181 186