@@ -50,7 +50,7 @@ use hir_def::{
50
50
resolver:: { HasResolver , Resolver } ,
51
51
src:: HasSource as _,
52
52
AdtId , AssocItemId , AssocItemLoc , AttrDefId , ConstId , ConstParamId , DefWithBodyId , EnumId ,
53
- FunctionId , GenericDefId , HasModule , ImplId , ItemContainerId , LifetimeParamId ,
53
+ EnumVariantId , FunctionId , GenericDefId , HasModule , ImplId , ItemContainerId , LifetimeParamId ,
54
54
LocalEnumVariantId , LocalFieldId , Lookup , MacroExpander , MacroId , ModuleId , StaticId , StructId ,
55
55
TraitId , TypeAliasId , TypeOrConstParamId , TypeParamId , UnionId ,
56
56
} ;
@@ -348,7 +348,10 @@ impl ModuleDef {
348
348
ModuleDef :: Module ( it) => it. id . into ( ) ,
349
349
ModuleDef :: Const ( it) => it. id . into ( ) ,
350
350
ModuleDef :: Static ( it) => it. id . into ( ) ,
351
- _ => return Vec :: new ( ) ,
351
+ ModuleDef :: Variant ( it) => {
352
+ EnumVariantId { parent : it. parent . into ( ) , local_id : it. id } . into ( )
353
+ }
354
+ ModuleDef :: BuiltinType ( _) | ModuleDef :: Macro ( _) => return Vec :: new ( ) ,
352
355
} ;
353
356
354
357
let module = match self . module ( db) {
@@ -537,6 +540,12 @@ impl Module {
537
540
}
538
541
acc. extend ( decl. diagnostics ( db) )
539
542
}
543
+ ModuleDef :: Adt ( Adt :: Enum ( e) ) => {
544
+ for v in e. variants ( db) {
545
+ acc. extend ( ModuleDef :: Variant ( v) . diagnostics ( db) ) ;
546
+ }
547
+ acc. extend ( decl. diagnostics ( db) )
548
+ }
540
549
_ => acc. extend ( decl. diagnostics ( db) ) ,
541
550
}
542
551
}
0 commit comments