@@ -2186,11 +2186,12 @@ impl Clean<Vec<Item>> for doctree::Import<'_> {
21862186 }
21872187}
21882188
2189- impl Clean < Item > for doctree :: ForeignItem < ' _ > {
2189+ impl Clean < Item > for ( & hir :: ForeignItem < ' _ > , Option < Ident > ) {
21902190 fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
2191- let kind = match self . kind {
2191+ let ( item, renamed) = self ;
2192+ let kind = match item. kind {
21922193 hir:: ForeignItemKind :: Fn ( ref decl, ref names, ref generics) => {
2193- let abi = cx. tcx . hir ( ) . get_foreign_abi ( self . id ) ;
2194+ let abi = cx. tcx . hir ( ) . get_foreign_abi ( item . hir_id ) ;
21942195 let ( generics, decl) =
21952196 enter_impl_trait ( cx, || ( generics. clean ( cx) , ( & * * decl, & names[ ..] ) . clean ( cx) ) ) ;
21962197 let ( all_types, ret_types) = get_all_types ( & generics, & decl, cx) ;
@@ -2207,15 +2208,13 @@ impl Clean<Item> for doctree::ForeignItem<'_> {
22072208 ret_types,
22082209 } )
22092210 }
2210- hir:: ForeignItemKind :: Static ( ref ty, mutbl) => ForeignStaticItem ( Static {
2211- type_ : ty. clean ( cx) ,
2212- mutability : * mutbl,
2213- expr : String :: new ( ) ,
2214- } ) ,
2211+ hir:: ForeignItemKind :: Static ( ref ty, mutability) => {
2212+ ForeignStaticItem ( Static { type_ : ty. clean ( cx) , mutability, expr : String :: new ( ) } )
2213+ }
22152214 hir:: ForeignItemKind :: Type => ForeignTypeItem ,
22162215 } ;
22172216
2218- Item :: from_hir_id_and_parts ( self . id , Some ( self . name ) , kind, cx)
2217+ Item :: from_hir_id_and_parts ( item . hir_id , Some ( renamed . unwrap_or ( item . ident ) . name ) , kind, cx)
22192218 }
22202219}
22212220
0 commit comments