aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/item_scope.rs')
-rw-r--r--crates/hir_def/src/item_scope.rs27
1 files changed, 19 insertions, 8 deletions
diff --git a/crates/hir_def/src/item_scope.rs b/crates/hir_def/src/item_scope.rs
index 4ddfd9ee6..a8ee5eeac 100644
--- a/crates/hir_def/src/item_scope.rs
+++ b/crates/hir_def/src/item_scope.rs
@@ -287,14 +287,25 @@ impl ItemScope {
287 } 287 }
288 288
289 pub(crate) fn shrink_to_fit(&mut self) { 289 pub(crate) fn shrink_to_fit(&mut self) {
290 self.types.shrink_to_fit(); 290 // Exhaustive match to require handling new fields.
291 self.values.shrink_to_fit(); 291 let Self {
292 self.macros.shrink_to_fit(); 292 types,
293 self.unresolved.shrink_to_fit(); 293 values,
294 self.defs.shrink_to_fit(); 294 macros,
295 self.impls.shrink_to_fit(); 295 unresolved,
296 self.unnamed_trait_imports.shrink_to_fit(); 296 defs,
297 self.legacy_macros.shrink_to_fit(); 297 impls,
298 unnamed_trait_imports,
299 legacy_macros,
300 } = self;
301 types.shrink_to_fit();
302 values.shrink_to_fit();
303 macros.shrink_to_fit();
304 unresolved.shrink_to_fit();
305 defs.shrink_to_fit();
306 impls.shrink_to_fit();
307 unnamed_trait_imports.shrink_to_fit();
308 legacy_macros.shrink_to_fit();
298 } 309 }
299} 310}
300 311