Skip to content

Commit

Permalink
Don't strip crate module
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 29, 2023
1 parent 6066037 commit 71ff7ef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/librustdoc/passes/strip_hidden.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@ impl<'a, 'tcx> DocFolder for Stripper<'a, 'tcx> {
// strip things like impl methods but when doing so
// we must not add any items to the `retained` set.
let old = mem::replace(&mut self.update_retained, false);
let ret = strip_item(self.set_is_in_hidden_item_and_fold(true, i));
let ret = self.set_is_in_hidden_item_and_fold(true, i);
self.update_retained = old;
Some(ret)
if ret.is_crate() {
// We don't strip the crate, even if it has `#[doc(hidden)]`.
Some(ret)
} else {
Some(strip_item(ret))
}
}
_ => {
let ret = self.set_is_in_hidden_item_and_fold(true, i);
Expand Down

0 comments on commit 71ff7ef

Please sign in to comment.