diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-04 01:56:46 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-04 01:56:46 +0100 |
commit | 6b43a518e6d12868ddd749c8ebead343ba823f5b (patch) | |
tree | e09d71efea4f64bdf957640111d9f7a037fb6538 /crates/hir_def/src/item_scope.rs | |
parent | 234ddf34c743924a15cca7480fb3b4db4581308e (diff) | |
parent | f774a56af20537f8a1e1da7ec98584bee8ceb635 (diff) |
Merge #8321
8321: Use exhaustive matches in shrink_to_fit impls r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/item_scope.rs')
-rw-r--r-- | crates/hir_def/src/item_scope.rs | 27 |
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 | ||