diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-03-29 16:16:02 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-03-29 16:17:45 +0200 |
| commit | 71ff7ef17c260e1b29b58cdf359b50799d9449da (patch) | |
| tree | c29f9d700314ba404eaadaa03d71bbc28a427688 | |
| parent | 60660371efe59dfc99644e9d709a1b71e25ae2ac (diff) | |
| download | rust-71ff7ef17c260e1b29b58cdf359b50799d9449da.tar.gz rust-71ff7ef17c260e1b29b58cdf359b50799d9449da.zip | |
Don't strip crate module
| -rw-r--r-- | src/librustdoc/passes/strip_hidden.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustdoc/passes/strip_hidden.rs b/src/librustdoc/passes/strip_hidden.rs index 890b3e8d67f..a688aa14863 100644 --- a/src/librustdoc/passes/strip_hidden.rs +++ b/src/librustdoc/passes/strip_hidden.rs @@ -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); |
