From 2d99b5ead57c315739ccd22fdc6a08e8607cb05e Mon Sep 17 00:00:00 2001 From: Chayim Refael Friedman Date: Tue, 1 Apr 2025 06:58:21 +0300 Subject: [PATCH] Avoid relying on `block_def_map()` needlessly We can compute the wanted information from the block's interned data. --- crates/hir-ty/src/chalk_db.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/hir-ty/src/chalk_db.rs b/crates/hir-ty/src/chalk_db.rs index e0975b5aeb..f8f828276e 100644 --- a/crates/hir-ty/src/chalk_db.rs +++ b/crates/hir-ty/src/chalk_db.rs @@ -553,7 +553,7 @@ impl ChalkContext<'_> { let block_impls = iter::successors(self.block, |&block_id| { cov_mark::hit!(block_local_impls); - self.db.block_def_map(block_id).parent().and_then(|module| module.containing_block()) + block_id.loc(self.db).module.containing_block() }) .inspect(|&block_id| { // make sure we don't search the same block twice