File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,14 @@ impl<'a> DocFolder for Stripper<'a> {
38
38
fn fold_item ( & mut self , i : Item ) -> Option < Item > {
39
39
if i. attrs . lists ( sym:: doc) . has_word ( sym:: hidden) {
40
40
debug ! ( "strip_hidden: stripping {:?} {:?}" , i. type_( ) , i. name) ;
41
- // use a dedicated hidden item for given item type if any
41
+ // Use a dedicated hidden item for fields, variants, and modules.
42
+ // We need to keep private fields and variants, so that the docs
43
+ // can show a placeholder "// some variants omitted". We need to keep
44
+ // private modules, because they can contain impl blocks, and impl
45
+ // block privacy is inherited from the type and trait, not from the
46
+ // module it's defined in. Both of these are marked "stripped," and
47
+ // not included in the final docs, but since they still have an effect
48
+ // on the final doc, cannot be completely removed from the Clean IR.
42
49
match * i. kind {
43
50
clean:: StructFieldItem ( ..) | clean:: ModuleItem ( ..) | clean:: VariantItem ( ..) => {
44
51
// We need to recurse into stripped modules to
You can’t perform that action at this time.
0 commit comments