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:
parent
d4dfb7d84c
commit
c05cfab7f9
1 changed files with 5 additions and 1 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue