File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,8 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
260
260
}
261
261
// TODO: this should also take the span into account (inner or outer)
262
262
ItemKind :: Mod ( ref mod_) => NotInlined ( mod_. clean ( cx) ) ,
263
- ItemKind :: ForeignMod ( ref mod_) => NotInlined ( mod_. clean ( cx) ) ,
263
+ // `extern "C" { ... }`
264
+ ItemKind :: ForeignMod ( ref mod_) => MaybeInlined :: InlinedWithoutOriginal ( mod_. clean ( cx) ) ,
264
265
ItemKind :: GlobalAsm ( ..) => MaybeInlined :: InlinedWithoutOriginal ( vec ! [ ] ) , // not handled
265
266
ItemKind :: TyAlias ( ty, ref generics) => {
266
267
let rustdoc_ty = ty. clean ( cx) ;
@@ -403,9 +404,9 @@ impl Clean<ItemKind> for hir::Mod<'_> {
403
404
}
404
405
}
405
406
406
- impl Clean < ItemKind > for hir:: ForeignMod < ' _ > {
407
- fn clean ( & self , cx : & DocContext < ' _ > ) -> ItemKind {
408
- ModuleItem ( Module { is_crate : false , items : self . items . clean ( cx) } )
407
+ impl Clean < Vec < Item > > for hir:: ForeignMod < ' _ > {
408
+ fn clean ( & self , cx : & DocContext < ' _ > ) -> Vec < Item > {
409
+ self . items . iter ( ) . map ( |x| x . clean ( cx) ) . collect ( )
409
410
}
410
411
}
411
412
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ crate fn run_format<T: FormatRenderer>(
82
82
// recurse into the items of the module as well.
83
83
let name = item. name . as_ref ( ) . unwrap ( ) . to_string ( ) ;
84
84
if name. is_empty ( ) {
85
- panic ! ( "Unexpected module with empty name" ) ;
85
+ panic ! ( "Unexpected module with empty name: {:?}" , item ) ;
86
86
}
87
87
88
88
cx. mod_item_in ( & item, & name, & cache) ?;
You can’t perform that action at this time.
0 commit comments