Skip to content

Commit dc8836f

Browse files
committed
---
yaml --- r: 152018 b: refs/heads/try2 c: 5ee3d0e h: refs/heads/master v: v3
1 parent 141377b commit dc8836f

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 9181c35ee925240fc129d77695e3f88c6d5f0f2b
8+
refs/heads/try2: 5ee3d0e1ffa6e190d73815ba4754b2618528c83e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustdoc/clean.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,8 +1575,12 @@ fn try_inline(id: ast::NodeId) -> Option<Vec<Item>> {
15751575
};
15761576
let did = ast_util::def_id_of_def(def);
15771577
if ast_util::is_local(did) { return None }
1578+
try_inline_def(tcx, def)
1579+
}
15781580

1581+
fn try_inline_def(tcx: &ty::ctxt, def: ast::Def) -> Option<Vec<Item>> {
15791582
let mut ret = Vec::new();
1583+
let did = ast_util::def_id_of_def(def);
15801584
let inner = match def {
15811585
ast::DefTrait(did) => TraitItem(build_external_trait(tcx, did)),
15821586
ast::DefFn(did, style) =>
@@ -1592,6 +1596,7 @@ fn try_inline(id: ast::NodeId) -> Option<Vec<Item>> {
15921596
// Assume that the enum type is reexported next to the variant, and
15931597
// variants don't show up in documentation specially.
15941598
ast::DefVariant(..) => return Some(Vec::new()),
1599+
ast::DefMod(did) => ModuleItem(build_module(tcx, did)),
15951600
_ => return None,
15961601
};
15971602
let fqn = csearch::get_item_path(tcx, did);
@@ -1995,6 +2000,28 @@ fn build_impl(tcx: &ty::ctxt, did: ast::DefId) -> Item {
19952000
}
19962001
}
19972002

2003+
fn build_module(tcx: &ty::ctxt, did: ast::DefId) -> Module {
2004+
let mut items = Vec::new();
2005+
2006+
csearch::each_child_of_item(&tcx.sess.cstore, did, |def, _, _| {
2007+
match def {
2008+
decoder::DlDef(def) => {
2009+
match try_inline_def(tcx, def) {
2010+
Some(i) => items.extend(i.move_iter()),
2011+
None => {}
2012+
}
2013+
}
2014+
decoder::DlImpl(did) => items.push(build_impl(tcx, did)),
2015+
decoder::DlField => fail!("unimplemented field"),
2016+
}
2017+
});
2018+
2019+
Module {
2020+
items: items,
2021+
is_crate: false,
2022+
}
2023+
}
2024+
19982025
fn resolve_use_source(path: Path, id: ast::NodeId) -> ImportSource {
19992026
ImportSource {
20002027
path: path,

0 commit comments

Comments
 (0)