aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-04 01:56:11 +0100
committerJonas Schievink <[email protected]>2021-04-04 01:56:11 +0100
commitf774a56af20537f8a1e1da7ec98584bee8ceb635 (patch)
treee09d71efea4f64bdf957640111d9f7a037fb6538 /crates/hir_def/src/nameres.rs
parent234ddf34c743924a15cca7480fb3b4db4581308e (diff)
Use exhaustive matches in shrink_to_fit impls
Diffstat (limited to 'crates/hir_def/src/nameres.rs')
-rw-r--r--crates/hir_def/src/nameres.rs24
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 }