File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ pub enum Target {
2929 TyAlias ,
3030 OpaqueTy ,
3131 Enum ,
32+ Variant ,
3233 Struct ,
3334 Union ,
3435 Trait ,
@@ -62,6 +63,7 @@ impl Display for Target {
6263 Target :: TyAlias => "type alias" ,
6364 Target :: OpaqueTy => "opaque type" ,
6465 Target :: Enum => "enum" ,
66+ Target :: Variant => "enum variant" ,
6567 Target :: Struct => "struct" ,
6668 Target :: Union => "union" ,
6769 Target :: Trait => "trait" ,
Original file line number Diff line number Diff line change @@ -30,7 +30,13 @@ struct LanguageItemCollector<'tcx> {
3030
3131impl ItemLikeVisitor < ' v > for LanguageItemCollector < ' tcx > {
3232 fn visit_item ( & mut self , item : & hir:: Item < ' _ > ) {
33- self . check_for_lang ( Target :: from_item ( item) , item. hir_id , item. attrs )
33+ self . check_for_lang ( Target :: from_item ( item) , item. hir_id , item. attrs ) ;
34+
35+ if let hir:: ItemKind :: Enum ( def, ..) = & item. kind {
36+ for variant in def. variants {
37+ self . check_for_lang ( Target :: Variant , variant. id , variant. attrs ) ;
38+ }
39+ }
3440 }
3541
3642 fn visit_trait_item ( & mut self , trait_item : & hir:: TraitItem < ' _ > ) {
You can’t perform that action at this time.
0 commit comments