File tree Expand file tree Collapse file tree 2 files changed +38
-13
lines changed Expand file tree Collapse file tree 2 files changed +38
-13
lines changed Original file line number Diff line number Diff line change @@ -287,14 +287,25 @@ impl ItemScope {
287287 }
288288
289289 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 ( ) ;
290+ // Exhaustive match to require handling new fields.
291+ let Self {
292+ types,
293+ values,
294+ macros,
295+ unresolved,
296+ defs,
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 ( ) ;
298309 }
299310}
300311
Original file line number Diff line number Diff line change @@ -411,11 +411,25 @@ impl DefMap {
411411 }
412412
413413 fn shrink_to_fit ( & mut self ) {
414- self . extern_prelude . shrink_to_fit ( ) ;
415- self . exported_proc_macros . shrink_to_fit ( ) ;
416- self . diagnostics . shrink_to_fit ( ) ;
417- self . modules . shrink_to_fit ( ) ;
418- for ( _, module) in self . modules . iter_mut ( ) {
414+ // Exhaustive match to require handling new fields.
415+ let Self {
416+ _c : _,
417+ exported_proc_macros,
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 ( ) {
419433 module. children . shrink_to_fit ( ) ;
420434 module. scope . shrink_to_fit ( ) ;
421435 }
You can’t perform that action at this time.
0 commit comments