@@ -364,27 +364,33 @@ fn build_impl(cx: &core::DocContext,
364
364
fn build_module ( cx : & core:: DocContext , tcx : & ty:: ctxt ,
365
365
did : ast:: DefId ) -> clean:: Module {
366
366
let mut items = Vec :: new ( ) ;
367
+ fill_in ( cx, tcx, did, & mut items) ;
368
+ return clean:: Module {
369
+ items : items,
370
+ is_crate : false ,
371
+ } ;
367
372
368
373
// FIXME: this doesn't handle reexports inside the module itself.
369
374
// Should they be handled?
370
- csearch:: each_child_of_item ( & tcx. sess . cstore , did, |def, _, vis| {
371
- if vis != ast:: Public { return }
372
- match def {
373
- decoder:: DlDef ( def) => {
374
- match try_inline_def ( cx, tcx, def) {
375
- Some ( i) => items. extend ( i. move_iter ( ) ) ,
376
- None => { }
375
+ fn fill_in ( cx : & core:: DocContext , tcx : & ty:: ctxt , did : ast:: DefId ,
376
+ items : & mut Vec < clean:: Item > ) {
377
+ csearch:: each_child_of_item ( & tcx. sess . cstore , did, |def, _, vis| {
378
+ match def {
379
+ decoder:: DlDef ( def:: DefForeignMod ( did) ) => {
380
+ fill_in ( cx, tcx, did, items) ;
381
+ }
382
+ decoder:: DlDef ( def) if vis == ast:: Public => {
383
+ match try_inline_def ( cx, tcx, def) {
384
+ Some ( i) => items. extend ( i. move_iter ( ) ) ,
385
+ None => { }
386
+ }
377
387
}
388
+ decoder:: DlDef ( ..) => { }
389
+ // All impls were inlined above
390
+ decoder:: DlImpl ( ..) => { }
391
+ decoder:: DlField => fail ! ( "unimplemented field" ) ,
378
392
}
379
- // All impls were inlined above
380
- decoder:: DlImpl ( ..) => { }
381
- decoder:: DlField => fail ! ( "unimplemented field" ) ,
382
- }
383
- } ) ;
384
-
385
- clean:: Module {
386
- items : items,
387
- is_crate : false ,
393
+ } ) ;
388
394
}
389
395
}
390
396
0 commit comments