@@ -2186,11 +2186,12 @@ impl Clean<Vec<Item>> for doctree::Import<'_> {
2186
2186
}
2187
2187
}
2188
2188
2189
- impl Clean < Item > for doctree :: ForeignItem < ' _ > {
2189
+ impl Clean < Item > for ( & hir :: ForeignItem < ' _ > , Option < Ident > ) {
2190
2190
fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
2191
- let kind = match self . kind {
2191
+ let ( item, renamed) = self ;
2192
+ let kind = match item. kind {
2192
2193
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 ) ;
2194
2195
let ( generics, decl) =
2195
2196
enter_impl_trait ( cx, || ( generics. clean ( cx) , ( & * * decl, & names[ ..] ) . clean ( cx) ) ) ;
2196
2197
let ( all_types, ret_types) = get_all_types ( & generics, & decl, cx) ;
@@ -2207,15 +2208,13 @@ impl Clean<Item> for doctree::ForeignItem<'_> {
2207
2208
ret_types,
2208
2209
} )
2209
2210
}
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
+ }
2215
2214
hir:: ForeignItemKind :: Type => ForeignTypeItem ,
2216
2215
} ;
2217
2216
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)
2219
2218
}
2220
2219
}
2221
2220
0 commit comments