@@ -1840,11 +1840,11 @@ impl Clean<VariantStruct> for rustc_hir::VariantData<'_> {
18401840impl Clean < Item > for ty:: VariantDef {
18411841 fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
18421842 let kind = match self . ctor_kind {
1843- CtorKind :: Const => VariantKind :: CLike ,
1844- CtorKind :: Fn => VariantKind :: Tuple (
1843+ CtorKind :: Const => Variant :: CLike ,
1844+ CtorKind :: Fn => Variant :: Tuple (
18451845 self . fields . iter ( ) . map ( |f| cx. tcx . type_of ( f. did ) . clean ( cx) ) . collect ( ) ,
18461846 ) ,
1847- CtorKind :: Fictive => VariantKind :: Struct ( VariantStruct {
1847+ CtorKind :: Fictive => Variant :: Struct ( VariantStruct {
18481848 struct_type : doctree:: Plain ,
18491849 fields_stripped : false ,
18501850 fields : self
@@ -1861,25 +1861,21 @@ impl Clean<Item> for ty::VariantDef {
18611861 . collect ( ) ,
18621862 } ) ,
18631863 } ;
1864- let what_rustc_thinks = Item :: from_def_id_and_parts (
1865- self . def_id ,
1866- Some ( self . ident . name ) ,
1867- VariantItem ( Variant { kind } ) ,
1868- cx,
1869- ) ;
1864+ let what_rustc_thinks =
1865+ Item :: from_def_id_and_parts ( self . def_id , Some ( self . ident . name ) , VariantItem ( kind) , cx) ;
18701866 // don't show `pub` for fields, which are always public
18711867 Item { visibility : Inherited , ..what_rustc_thinks }
18721868 }
18731869}
18741870
1875- impl Clean < VariantKind > for hir:: VariantData < ' _ > {
1876- fn clean ( & self , cx : & DocContext < ' _ > ) -> VariantKind {
1871+ impl Clean < Variant > for hir:: VariantData < ' _ > {
1872+ fn clean ( & self , cx : & DocContext < ' _ > ) -> Variant {
18771873 match self {
1878- hir:: VariantData :: Struct ( ..) => VariantKind :: Struct ( self . clean ( cx) ) ,
1874+ hir:: VariantData :: Struct ( ..) => Variant :: Struct ( self . clean ( cx) ) ,
18791875 hir:: VariantData :: Tuple ( ..) => {
1880- VariantKind :: Tuple ( self . fields ( ) . iter ( ) . map ( |x| x. ty . clean ( cx) ) . collect ( ) )
1876+ Variant :: Tuple ( self . fields ( ) . iter ( ) . map ( |x| x. ty . clean ( cx) ) . collect ( ) )
18811877 }
1882- hir:: VariantData :: Unit ( ..) => VariantKind :: CLike ,
1878+ hir:: VariantData :: Unit ( ..) => Variant :: CLike ,
18831879 }
18841880 }
18851881}
@@ -2048,7 +2044,7 @@ impl Clean<Vec<Item>> for (&hir::Item<'_>, Option<Symbol>) {
20482044
20492045impl Clean < Item > for hir:: Variant < ' _ > {
20502046 fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
2051- let kind = VariantItem ( Variant { kind : self . data . clean ( cx) } ) ;
2047+ let kind = VariantItem ( self . data . clean ( cx) ) ;
20522048 let what_rustc_thinks =
20532049 Item :: from_hir_id_and_parts ( self . id , Some ( self . ident . name ) , kind, cx) ;
20542050 // don't show `pub` for variants, which are always public
0 commit comments