diff options
author | Jonas Schievink <[email protected]> | 2021-02-04 12:44:54 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-02-04 12:44:54 +0000 |
commit | 26a2a2433c7bae1533d07a38a6003e6f40fa97d9 (patch) | |
tree | c1a3bbed8832b554c6991802f728d99ea6ced088 /crates/hir_def/src/nameres/collector.rs | |
parent | 01bc1fdff8b04d373e794af29b18243eb9d15e34 (diff) |
Don't keep the parent DefMap alive via Arc
This seems like it could easily leak a lot of memory since we don't
currently run GC
Diffstat (limited to 'crates/hir_def/src/nameres/collector.rs')
-rw-r--r-- | crates/hir_def/src/nameres/collector.rs | 9 |
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 | { |