Avoid relying on block_def_map() needlessly

We can compute the wanted information from the block's interned data.
This commit is contained in:
Chayim Refael Friedman 2025-04-01 06:58:21 +03:00
parent fb133c8c80
commit 2d99b5ead5

View File

@ -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