@@ -261,6 +261,7 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
261
261
}
262
262
// TODO: this should also take the span into account (inner or outer)
263
263
ItemKind :: Mod ( ref mod_) => NotInlined ( mod_. clean ( cx) ) ,
264
+ ItemKind :: ForeignMod ( ref mod_) => NotInlined ( mod_. clean ( cx) ) ,
264
265
ItemKind :: Union ( ref variant_data, ref generics) => NotInlined ( UnionItem ( Union {
265
266
struct_type : doctree:: struct_type_from_def ( & variant_data) ,
266
267
generics : generics. clean ( cx) ,
@@ -360,6 +361,12 @@ impl Clean<ItemKind> for hir::Mod<'_> {
360
361
}
361
362
}
362
363
364
+ impl Clean < ItemKind > for hir:: ForeignMod < ' _ > {
365
+ fn clean ( & self , cx : & DocContext < ' _ > ) -> ItemKind {
366
+ ModuleItem ( Module { is_crate : false , items : self . items . clean ( cx) } )
367
+ }
368
+ }
369
+
363
370
impl Clean < Vec < Item > > for hir:: ItemId {
364
371
fn clean ( & self , cx : & DocContext < ' _ > ) -> Vec < Item > {
365
372
cx. tcx . hir ( ) . item ( self . id ) . clean ( cx)
@@ -2275,11 +2282,11 @@ fn clean_import(
2275
2282
MaybeInlined :: NotInlined ( ImportItem ( kind) )
2276
2283
}
2277
2284
2278
- impl Clean < Item > for doctree :: ForeignItem < ' _ > {
2285
+ impl Clean < Item > for hir :: ForeignItem < ' _ > {
2279
2286
fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
2280
2287
let kind = match self . kind {
2281
2288
hir:: ForeignItemKind :: Fn ( ref decl, ref names, ref generics) => {
2282
- let abi = cx. tcx . hir ( ) . get_foreign_abi ( self . id ) ;
2289
+ let abi = cx. tcx . hir ( ) . get_foreign_abi ( self . hir_id ) ;
2283
2290
let ( generics, decl) =
2284
2291
enter_impl_trait ( cx, || ( generics. clean ( cx) , ( & * * decl, & names[ ..] ) . clean ( cx) ) ) ;
2285
2292
let ( all_types, ret_types) = get_all_types ( & generics, & decl, cx) ;
@@ -2296,15 +2303,13 @@ impl Clean<Item> for doctree::ForeignItem<'_> {
2296
2303
ret_types,
2297
2304
} )
2298
2305
}
2299
- hir:: ForeignItemKind :: Static ( ref ty, mutbl) => ForeignStaticItem ( Static {
2300
- type_ : ty. clean ( cx) ,
2301
- mutability : * mutbl,
2302
- expr : String :: new ( ) ,
2303
- } ) ,
2306
+ hir:: ForeignItemKind :: Static ( ref ty, mutability) => {
2307
+ ForeignStaticItem ( Static { type_ : ty. clean ( cx) , mutability, expr : String :: new ( ) } )
2308
+ }
2304
2309
hir:: ForeignItemKind :: Type => ForeignTypeItem ,
2305
2310
} ;
2306
2311
2307
- Item :: from_hir_id_and_parts ( self . id , Some ( self . name ) , kind, cx)
2312
+ Item :: from_hir_id_and_parts ( self . hir_id , Some ( self . ident . name ) , kind, cx)
2308
2313
}
2309
2314
}
2310
2315
0 commit comments