Skip to content

Commit 5890d52

Browse files
lifthrasiiralexcrichton
authored andcommitted
---
yaml --- r: 110582 b: refs/heads/master c: 85299e3 h: refs/heads/master v: v3
1 parent fe09dd5 commit 5890d52

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 34ece7ad718469b4634d5eadd91d078d95bbd6c5
2+
refs/heads/master: 85299e360cda49d61b8d9a509319e19bc206c336
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: e263ef1df7b892ed29e53313565eb05ab75e52f4
55
refs/heads/try: 597a645456b55e1c886ce15d23a192abdf4d55cf

trunk/src/librustdoc/html/render.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,11 @@ pub fn run(mut krate: clean::Crate, dst: Path) -> io::IoResult<()> {
262262
cache.stack.push(krate.name.clone());
263263
krate = cache.fold_crate(krate);
264264
{
265+
let Cache { search_index: ref mut index,
266+
orphan_methods: ref meths, paths: ref mut paths, ..} = cache;
267+
265268
// Attach all orphan methods to the type's definition if the type
266269
// has since been learned.
267-
let Cache { search_index: ref mut index,
268-
orphan_methods: ref meths, paths: ref paths, ..} = cache;
269270
for &(ref pid, ref item) in meths.iter() {
270271
match paths.find(pid) {
271272
Some(&(ref fqp, _)) => {
@@ -280,6 +281,18 @@ pub fn run(mut krate: clean::Crate, dst: Path) -> io::IoResult<()> {
280281
None => {}
281282
}
282283
};
284+
285+
// Prune the paths that do not appear in the index.
286+
let mut unseen: HashSet<ast::NodeId> = paths.keys().map(|&id| id).collect();
287+
for item in index.iter() {
288+
match item.parent {
289+
Some(ref pid) => { unseen.remove(pid); }
290+
None => {}
291+
}
292+
}
293+
for pid in unseen.iter() {
294+
paths.remove(pid);
295+
}
283296
}
284297

285298
// Publish the search index

0 commit comments

Comments
 (0)