aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_scope.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-03 22:45:27 +0100
committerJonas Schievink <[email protected]>2021-04-03 22:45:27 +0100
commitd1bce6070def3b4d5045c3fc4bb66904d50d0a40 (patch)
treef671f0e97d91f9392f90911ebcb62df8eea958ea /crates/hir_def/src/item_scope.rs
parentb78f1a0a4d90276c7bd99bd0e5ac6959578be76a (diff)
Use shrink_to_fit to reduce DefMap sizes
Diffstat (limited to 'crates/hir_def/src/item_scope.rs')
-rw-r--r--crates/hir_def/src/item_scope.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_scope.rs b/crates/hir_def/src/item_scope.rs
index f3ebe7c72..4ddfd9ee6 100644
--- a/crates/hir_def/src/item_scope.rs
+++ b/crates/hir_def/src/item_scope.rs
@@ -285,6 +285,17 @@ impl ItemScope {
285 buf.push('\n'); 285 buf.push('\n');
286 } 286 }
287 } 287 }
288
289 pub(crate) fn shrink_to_fit(&mut self) {
290 self.types.shrink_to_fit();
291 self.values.shrink_to_fit();
292 self.macros.shrink_to_fit();
293 self.unresolved.shrink_to_fit();
294 self.defs.shrink_to_fit();
295 self.impls.shrink_to_fit();
296 self.unnamed_trait_imports.shrink_to_fit();
297 self.legacy_macros.shrink_to_fit();
298 }
288} 299}
289 300
290impl PerNs { 301impl PerNs {