Skip to content

Commit 719dca9

Browse files
committed
show ghost for hidden extern crate
1 parent d1b1476 commit 719dca9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ fn item_module(cx: &Context<'_>, item: &clean::Item, items: &[clean::Item]) -> i
357357
clean::ExternCrateItem { ref src } => {
358358
use crate::html::format::print_anchor;
359359

360+
let visibility_and_hidden = visibility_and_hidden(myitem);
360361
write!(w, "<dt><code>")?;
361362
render_attributes_in_code(w, myitem, "", cx)?;
362363
match *src {
@@ -382,7 +383,7 @@ fn item_module(cx: &Context<'_>, item: &clean::Item, items: &[clean::Item]) -> i
382383
)?;
383384
}
384385
}
385-
write!(w, "</code></dt>")?
386+
write!(w, "</code>{visibility_and_hidden}</dt>")?
386387
}
387388
clean::ImportItem(ref import) => {
388389
let stab_tags =

tests/rustdoc-html/display-hidden-items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//@ has 'foo/index.html'
88
//@ has - '//dt/span[@title="Hidden item"]' '👻'
99

10-
//@ matchesraw 'foo/index.html' '(?s)<dt><code><div class="code-attribute">#\[doc\(hidden\)\]</div>pub extern crate .*?hidden_(?:<wbr>)?core;</code></dt>'
10+
//@ matchesraw 'foo/index.html' '(?s)<dt><code><div class="code-attribute">#\[doc\(hidden\)\]</div>pub extern crate .*?hidden_(?:<wbr>)?core;</code><span title="Hidden item">&nbsp;👻</span> </dt>'
1111
#[doc(hidden)]
1212
pub extern crate core as hidden_core;
1313

0 commit comments

Comments
 (0)