Merge pull request #19492 from ChayimFriedman2/experiment

Avoid relying on `block_def_map()` needlessly
This commit is contained in:
Chayim Refael Friedman 2025-04-01 04:08:26 +00:00 committed by GitHub
commit cdcadb4265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -552,7 +552,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