Skip to content

Commit 05780ac

Browse files
committed
Don't record the root module in the search index
1 parent 439e184 commit 05780ac

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/librustdoc/html/render.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -1058,14 +1058,16 @@ impl DocFolder for Cache {
10581058
}
10591059
});
10601060

1061-
self.search_index.push(IndexItem {
1062-
ty: shortty(&item),
1063-
name: s.to_string(),
1064-
path: path.join("::").to_string(),
1065-
desc: shorter(item.doc_value()),
1066-
parent: parent,
1067-
search_type: get_index_search_type(&item, parent_basename),
1068-
});
1061+
if item.def_id.index != CRATE_DEF_INDEX {
1062+
self.search_index.push(IndexItem {
1063+
ty: shortty(&item),
1064+
name: s.to_string(),
1065+
path: path.join("::").to_string(),
1066+
desc: shorter(item.doc_value()),
1067+
parent: parent,
1068+
search_type: get_index_search_type(&item, parent_basename),
1069+
});
1070+
}
10691071
}
10701072
(Some(parent), None) if is_method || (!self.privmod && !hidden_field)=> {
10711073
if parent.is_local() {

0 commit comments

Comments
 (0)