@@ -1834,23 +1834,21 @@ fn clean_variant_data<'tcx>(
18341834 }
18351835}
18361836
1837- impl < ' tcx > Clean < ' tcx , Item > for ty:: VariantDef {
1838- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> Item {
1839- let kind = match self . ctor_kind {
1840- CtorKind :: Const => Variant :: CLike ,
1841- CtorKind :: Fn => Variant :: Tuple (
1842- self . fields . iter ( ) . map ( |field| clean_middle_field ( field, cx) ) . collect ( ) ,
1843- ) ,
1844- CtorKind :: Fictive => Variant :: Struct ( VariantStruct {
1845- struct_type : CtorKind :: Fictive ,
1846- fields : self . fields . iter ( ) . map ( |field| clean_middle_field ( field, cx) ) . collect ( ) ,
1847- } ) ,
1848- } ;
1849- let what_rustc_thinks =
1850- Item :: from_def_id_and_parts ( self . def_id , Some ( self . name ) , VariantItem ( kind) , cx) ;
1851- // don't show `pub` for variants, which always inherit visibility
1852- Item { visibility : Inherited , ..what_rustc_thinks }
1853- }
1837+ pub ( crate ) fn clean_variant_def < ' tcx > ( variant : & ty:: VariantDef , cx : & mut DocContext < ' tcx > ) -> Item {
1838+ let kind = match variant. ctor_kind {
1839+ CtorKind :: Const => Variant :: CLike ,
1840+ CtorKind :: Fn => Variant :: Tuple (
1841+ variant. fields . iter ( ) . map ( |field| clean_middle_field ( field, cx) ) . collect ( ) ,
1842+ ) ,
1843+ CtorKind :: Fictive => Variant :: Struct ( VariantStruct {
1844+ struct_type : CtorKind :: Fictive ,
1845+ fields : variant. fields . iter ( ) . map ( |field| clean_middle_field ( field, cx) ) . collect ( ) ,
1846+ } ) ,
1847+ } ;
1848+ let what_rustc_thinks =
1849+ Item :: from_def_id_and_parts ( variant. def_id , Some ( variant. name ) , VariantItem ( kind) , cx) ;
1850+ // don't show `pub` for variants, which always inherit visibility
1851+ Item { visibility : Inherited , ..what_rustc_thinks }
18541852}
18551853
18561854impl < ' tcx > Clean < ' tcx , Variant > for hir:: VariantData < ' tcx > {
0 commit comments