Skip to content

Commit e0d10bb

Browse files
committed
auto merge of #16016 : tomjakubowski/rust/rustdoc-fix-15490, r=alexcrichton
Previously, private and `#[doc(hidden)]` struct fields appeared in the search index despite being hidden from the struct's documentation. Fix #15490
2 parents ad4fa46 + c05cfab commit e0d10bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustdoc/html/render.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,12 @@ impl DocFolder for Cache {
845845
}
846846
_ => (None, Some(self.stack.as_slice()))
847847
};
848+
let hidden_field = match item.inner {
849+
clean::StructFieldItem(clean::HiddenStructField) => true,
850+
_ => false
851+
};
848852
match parent {
849-
(parent, Some(path)) if !self.privmod => {
853+
(parent, Some(path)) if !self.privmod && !hidden_field => {
850854
self.search_index.push(IndexItem {
851855
ty: shortty(&item),
852856
name: s.to_string(),

0 commit comments

Comments
 (0)