diff options
Diffstat (limited to 'crates/hir_def/src/nameres.rs')
-rw-r--r-- | crates/hir_def/src/nameres.rs | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index 6a09ad420..7dd68219f 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs | |||
@@ -411,11 +411,25 @@ impl DefMap { | |||
411 | } | 411 | } |
412 | 412 | ||
413 | fn shrink_to_fit(&mut self) { | 413 | fn shrink_to_fit(&mut self) { |
414 | self.extern_prelude.shrink_to_fit(); | 414 | // Exhaustive match to require handling new fields. |
415 | self.exported_proc_macros.shrink_to_fit(); | 415 | let Self { |
416 | self.diagnostics.shrink_to_fit(); | 416 | _c: _, |
417 | self.modules.shrink_to_fit(); | 417 | exported_proc_macros, |
418 | for (_, module) in self.modules.iter_mut() { | 418 | extern_prelude, |
419 | diagnostics, | ||
420 | modules, | ||
421 | block: _, | ||
422 | edition: _, | ||
423 | krate: _, | ||
424 | prelude: _, | ||
425 | root: _, | ||
426 | } = self; | ||
427 | |||
428 | extern_prelude.shrink_to_fit(); | ||
429 | exported_proc_macros.shrink_to_fit(); | ||
430 | diagnostics.shrink_to_fit(); | ||
431 | modules.shrink_to_fit(); | ||
432 | for (_, module) in modules.iter_mut() { | ||
419 | module.children.shrink_to_fit(); | 433 | module.children.shrink_to_fit(); |
420 | module.scope.shrink_to_fit(); | 434 | module.scope.shrink_to_fit(); |
421 | } | 435 | } |