1
Fork 0

rustdoc: Keep hidden struct fields out of search

Previously, private and `#[doc(hidden)]` struct fields appeared in the
search index despite being hidden from the struct's documentation.

Fix #15490
This commit is contained in:
Tom Jakubowski 2014-07-26 16:13:01 -07:00
parent d4dfb7d84c
commit c05cfab7f9

View file

@ -845,8 +845,12 @@ impl DocFolder for Cache {
}
_ => (None, Some(self.stack.as_slice()))
};
let hidden_field = match item.inner {
clean::StructFieldItem(clean::HiddenStructField) => true,
_ => false
};
match parent {
(parent, Some(path)) if !self.privmod => {
(parent, Some(path)) if !self.privmod && !hidden_field => {
self.search_index.push(IndexItem {
ty: shortty(&item),
name: s.to_string(),