@@ -275,6 +275,11 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
275
275
bounds : ty. bounds . clean ( cx) ,
276
276
generics : ty. generics . clean ( cx) ,
277
277
} ) ) ,
278
+ ItemKind :: Enum ( ref def, ref generics) => NotInlined ( EnumItem ( Enum {
279
+ variants : def. variants . iter ( ) . map ( |v| v. clean ( cx) ) . collect ( ) ,
280
+ generics : generics. clean ( cx) ,
281
+ variants_stripped : false ,
282
+ } ) ) ,
278
283
ItemKind :: Union ( ref variant_data, ref generics) => NotInlined ( UnionItem ( Union {
279
284
struct_type : doctree:: struct_type_from_def ( & variant_data) ,
280
285
generics : generics. clean ( cx) ,
@@ -1917,31 +1922,10 @@ impl Clean<VariantStruct> for rustc_hir::VariantData<'_> {
1917
1922
}
1918
1923
}
1919
1924
1920
- impl Clean < Item > for doctree :: Enum < ' _ > {
1925
+ impl Clean < Item > for hir :: Variant < ' _ > {
1921
1926
fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
1922
- Item :: from_hir_id_and_parts (
1923
- self . id ,
1924
- Some ( self . name ) ,
1925
- EnumItem ( Enum {
1926
- variants : self . variants . iter ( ) . map ( |v| v. clean ( cx) ) . collect ( ) ,
1927
- generics : self . generics . clean ( cx) ,
1928
- variants_stripped : false ,
1929
- } ) ,
1930
- cx,
1931
- )
1932
- }
1933
- }
1934
-
1935
- impl Clean < Item > for doctree:: Variant < ' _ > {
1936
- fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
1937
- let what_rustc_thinks = Item :: from_hir_id_and_parts (
1938
- self . id ,
1939
- Some ( self . name ) ,
1940
- VariantItem ( Variant { kind : self . def . clean ( cx) } ) ,
1941
- cx,
1942
- ) ;
1943
- // don't show `pub` for variants, which are always public
1944
- Item { visibility : Inherited , ..what_rustc_thinks }
1927
+ let kind = VariantItem ( Variant { kind : self . data . clean ( cx) } ) ;
1928
+ Item :: from_hir_id_and_parts ( self . id , Some ( self . ident . name ) , kind, cx)
1945
1929
}
1946
1930
}
1947
1931
0 commit comments