aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/collector.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-04 12:45:40 +0000
committerGitHub <[email protected]>2021-02-04 12:45:40 +0000
commit1bae5509ad64a560c4597a021ab467ba063d12c0 (patch)
treec1a3bbed8832b554c6991802f728d99ea6ced088 /crates/hir_def/src/nameres/collector.rs
parent01bc1fdff8b04d373e794af29b18243eb9d15e34 (diff)
parent26a2a2433c7bae1533d07a38a6003e6f40fa97d9 (diff)
Merge #7554
7554: Don't keep the parent DefMap alive via Arc r=jonas-schievink a=jonas-schievink This seems like it could easily leak a lot of memory since we don't currently run GC bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres/collector.rs')
-rw-r--r--crates/hir_def/src/nameres/collector.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs
index 6e86cc4a7..f904a97de 100644
--- a/crates/hir_def/src/nameres/collector.rs
+++ b/crates/hir_def/src/nameres/collector.rs
@@ -1449,10 +1449,11 @@ impl ModCollector<'_, '_> {
1449 if let Some(macro_call_id) = 1449 if let Some(macro_call_id) =
1450 ast_id.as_call_id(self.def_collector.db, self.def_collector.def_map.krate, |path| { 1450 ast_id.as_call_id(self.def_collector.db, self.def_collector.def_map.krate, |path| {
1451 path.as_ident().and_then(|name| { 1451 path.as_ident().and_then(|name| {
1452 self.def_collector 1452 self.def_collector.def_map.with_ancestor_maps(
1453 .def_map 1453 self.def_collector.db,
1454 .ancestor_maps(self.module_id) 1454 self.module_id,
1455 .find_map(|(map, module)| map[module].scope.get_legacy_macro(&name)) 1455 &mut |map, module| map[module].scope.get_legacy_macro(&name),
1456 )
1456 }) 1457 })
1457 }) 1458 })
1458 { 1459 {