Skip to content

Commit

Permalink
rustdoc: Keep hidden struct fields out of search
Browse files Browse the repository at this point in the history
Previously, private and `#[doc(hidden)]` struct fields appeared in the
search index despite being hidden from the struct's documentation.

Fix #15490
  • Loading branch information
tomjakubowski committed Jul 26, 2014
1 parent d4dfb7d commit c05cfab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustdoc/html/render.rs
Expand Up @@ -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(),
Expand Down

5 comments on commit c05cfab

@bors
Copy link
Contributor

@bors bors commented on c05cfab Jul 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at tomjakubowski@c05cfab

@bors
Copy link
Contributor

@bors bors commented on c05cfab Jul 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging tomjakubowski/rust/rustdoc-fix-15490 = c05cfab into auto

@bors
Copy link
Contributor

@bors bors commented on c05cfab Jul 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tomjakubowski/rust/rustdoc-fix-15490 = c05cfab merged ok, testing candidate = e0d10bb

@bors
Copy link
Contributor

@bors bors commented on c05cfab Jul 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = e0d10bb

Please sign in to comment.