Skip to content

Commit 1a13c13

Browse files
Fix extern crates not being hidden with doc(hidden)
1 parent 982c6f8 commit 1a13c13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustdoc/passes/strip_hidden.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ impl<'a, 'tcx> DocFolder for Stripper<'a, 'tcx> {
145145
let old = mem::replace(&mut self.update_retained, false);
146146
let ret = self.set_is_in_hidden_item_and_fold(true, i);
147147
self.update_retained = old;
148-
if ret.is_crate() {
149-
// We don't strip the crate, even if it has `#[doc(hidden)]`.
148+
if ret.is_crate() && ret.item_id.is_local() {
149+
// We don't strip the current crate, even if it has `#[doc(hidden)]`.
150+
debug!("strip_hidden: Not strippping local crate");
150151
Some(ret)
151152
} else {
152153
Some(strip_item(ret))

0 commit comments

Comments
 (0)