diff options
author | Jonas Schievink <[email protected]> | 2021-04-03 22:45:27 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-03 22:45:27 +0100 |
commit | d1bce6070def3b4d5045c3fc4bb66904d50d0a40 (patch) | |
tree | f671f0e97d91f9392f90911ebcb62df8eea958ea /crates/hir_def/src/nameres.rs | |
parent | b78f1a0a4d90276c7bd99bd0e5ac6959578be76a (diff) |
Use shrink_to_fit to reduce DefMap sizes
Diffstat (limited to 'crates/hir_def/src/nameres.rs')
-rw-r--r-- | crates/hir_def/src/nameres.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index 9e8e4e9ec..6a09ad420 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs | |||
@@ -409,6 +409,17 @@ impl DefMap { | |||
409 | } | 409 | } |
410 | } | 410 | } |
411 | } | 411 | } |
412 | |||
413 | fn shrink_to_fit(&mut self) { | ||
414 | self.extern_prelude.shrink_to_fit(); | ||
415 | self.exported_proc_macros.shrink_to_fit(); | ||
416 | self.diagnostics.shrink_to_fit(); | ||
417 | self.modules.shrink_to_fit(); | ||
418 | for (_, module) in self.modules.iter_mut() { | ||
419 | module.children.shrink_to_fit(); | ||
420 | module.scope.shrink_to_fit(); | ||
421 | } | ||
422 | } | ||
412 | } | 423 | } |
413 | 424 | ||
414 | impl ModuleData { | 425 | impl ModuleData { |