@@ -80,8 +80,8 @@ use crate::{
8080 path:: ModPath ,
8181 per_ns:: PerNs ,
8282 visibility:: { Visibility , VisibilityExplicity } ,
83- AstId , BlockId , BlockLoc , CrateRootModuleId , ExternCrateId , FunctionId , LocalModuleId , Lookup ,
84- MacroExpander , MacroId , ModuleId , ProcMacroId , UseId ,
83+ AstId , BlockId , BlockLoc , CrateRootModuleId , EnumId , EnumVariantId , ExternCrateId , FunctionId ,
84+ LocalModuleId , Lookup , MacroExpander , MacroId , ModuleId , ProcMacroId , UseId ,
8585} ;
8686
8787/// Contains the results of (early) name resolution.
@@ -113,6 +113,7 @@ pub struct DefMap {
113113 /// this contains all kinds of macro, not just `macro_rules!` macro.
114114 /// ExternCrateId being None implies it being imported from the general prelude import.
115115 macro_use_prelude : FxHashMap < Name , ( MacroId , Option < ExternCrateId > ) > ,
116+ pub ( crate ) enum_definitions : FxHashMap < EnumId , Box < [ EnumVariantId ] > > ,
116117
117118 /// Tracks which custom derives are in scope for an item, to allow resolution of derive helper
118119 /// attributes.
@@ -370,6 +371,7 @@ impl DefMap {
370371 macro_use_prelude : FxHashMap :: default ( ) ,
371372 derive_helpers_in_scope : FxHashMap :: default ( ) ,
372373 diagnostics : Vec :: new ( ) ,
374+ enum_definitions : FxHashMap :: default ( ) ,
373375 data : Arc :: new ( DefMapCrateData {
374376 extern_prelude : FxHashMap :: default ( ) ,
375377 exported_derives : FxHashMap :: default ( ) ,
@@ -612,12 +614,14 @@ impl DefMap {
612614 krate : _,
613615 prelude : _,
614616 data : _,
617+ enum_definitions,
615618 } = self ;
616619
617620 macro_use_prelude. shrink_to_fit ( ) ;
618621 diagnostics. shrink_to_fit ( ) ;
619622 modules. shrink_to_fit ( ) ;
620623 derive_helpers_in_scope. shrink_to_fit ( ) ;
624+ enum_definitions. shrink_to_fit ( ) ;
621625 for ( _, module) in modules. iter_mut ( ) {
622626 module. children . shrink_to_fit ( ) ;
623627 module. scope . shrink_to_fit ( ) ;
0 commit comments