File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 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<'_> {
260260 }
261261 // TODO: this should also take the span into account (inner or outer)
262262 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) ) ,
264265 ItemKind :: GlobalAsm ( ..) => MaybeInlined :: InlinedWithoutOriginal ( vec ! [ ] ) , // not handled
265266 ItemKind :: TyAlias ( ty, ref generics) => {
266267 let rustdoc_ty = ty. clean ( cx) ;
@@ -403,9 +404,9 @@ impl Clean<ItemKind> for hir::Mod<'_> {
403404 }
404405}
405406
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 ( )
409410 }
410411}
411412
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ crate fn run_format<T: FormatRenderer>(
8282 // recurse into the items of the module as well.
8383 let name = item. name . as_ref ( ) . unwrap ( ) . to_string ( ) ;
8484 if name. is_empty ( ) {
85- panic ! ( "Unexpected module with empty name" ) ;
85+ panic ! ( "Unexpected module with empty name: {:?}" , item ) ;
8686 }
8787
8888 cx. mod_item_in ( & item, & name, & cache) ?;
You can’t perform that action at this time.
0 commit comments