diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index d2a03d584027..0af3f3bc9934 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -511,17 +511,18 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: _ => "", }; - let visibility_emoji = match myitem.visibility(tcx) { + let visibility_and_hidden = match myitem.visibility(tcx) { Some(ty::Visibility::Restricted(_)) => { - " 🔒 " + if myitem.is_doc_hidden() { + " 🔒 " + } else { + // Don't separate with a space when there are two of them + " 🔒👻 " + } } + _ if myitem.is_doc_hidden() => " 👻 ", _ => "", }; - let hidden_emoji = if myitem.is_doc_hidden() { - " 👻 " - } else { - "" - }; w.write_str(ITEM_TABLE_ROW_OPEN); let docs = @@ -535,14 +536,13 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: w, "