Skip to content

Commit e6ab982

Browse files
committed
Reduce prominence of item-infos
- Remove border. - Reduce size of emoji slightly. - Remove details disclosure for unstable reason. This was inconsistent with our other details disclosures, and the detail revealed was usually better explained by clicking on the issue link.
1 parent ce3f3a5 commit e6ab982

File tree

4 files changed

+4
-29
lines changed

4 files changed

+4
-29
lines changed

src/librustdoc/html/render/mod.rs

+1-17
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ fn short_item_info(
682682

683683
// Render unstable items. But don't render "rustc_private" crates (internal compiler crates).
684684
// Those crates are permanently unstable so it makes no sense to render "unstable" everywhere.
685-
if let Some((StabilityLevel::Unstable { reason, issue, .. }, feature)) = item
685+
if let Some((StabilityLevel::Unstable { reason: _, issue, .. }, feature)) = item
686686
.stability(cx.tcx())
687687
.as_ref()
688688
.filter(|stab| stab.feature != sym::rustc_private)
@@ -702,22 +702,6 @@ fn short_item_info(
702702

703703
message.push_str(&format!(" ({})", feature));
704704

705-
if let Some(unstable_reason) = reason {
706-
let mut ids = cx.id_map.borrow_mut();
707-
message = format!(
708-
"<details><summary>{}</summary>{}</details>",
709-
message,
710-
MarkdownHtml(
711-
&unstable_reason.as_str(),
712-
&mut ids,
713-
error_codes,
714-
cx.shared.edition(),
715-
&cx.shared.playground,
716-
)
717-
.into_string()
718-
);
719-
}
720-
721705
extra_info.push(format!("<div class=\"stab unstable\">{}</div>", message));
722706
}
723707

src/librustdoc/html/static/css/rustdoc.css

+1-3
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,6 @@ body.blur > :not(#help) {
965965
display: table;
966966
}
967967
.stab {
968-
border-width: 1px;
969-
border-style: solid;
970968
padding: 3px;
971969
margin-bottom: 5px;
972970
font-size: 90%;
@@ -977,7 +975,7 @@ body.blur > :not(#help) {
977975
}
978976

979977
.stab .emoji {
980-
font-size: 1.5em;
978+
font-size: 1.2em;
981979
}
982980

983981
/* Black one-pixel outline around emoji shapes */

src/test/rustdoc-gui/item-info-width.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ goto: file://|DOC_PATH|/lib2/struct.Foo.html
44
size: (1100, 800)
55
// We check that ".item-info" is bigger than its content.
66
assert-css: (".item-info", {"width": "807px"})
7-
assert-css: (".item-info .stab", {"width": "343px"})
7+
assert-css: (".item-info .stab", {"width": "341px"})

src/test/rustdoc/issue-32374.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![feature(staged_api)]
22
#![doc(issue_tracker_base_url = "https://issue_url/")]
3-
4-
#![unstable(feature="test", issue = "32374")]
3+
#![unstable(feature = "test", issue = "32374")]
54

65
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab deprecated"]' \
76
// 'Deprecated'
@@ -23,12 +22,6 @@ pub struct T;
2322
// '👎 Deprecated since 1.0.0: deprecated'
2423
// @has issue_32374/struct.U.html '//*[@class="stab unstable"]' \
2524
// '🔬 This is a nightly-only experimental API. (test #32374)'
26-
// @has issue_32374/struct.U.html '//details' \
27-
// '🔬 This is a nightly-only experimental API. (test #32374)'
28-
// @has issue_32374/struct.U.html '//summary' \
29-
// '🔬 This is a nightly-only experimental API. (test #32374)'
30-
// @has issue_32374/struct.U.html '//details/p' \
31-
// 'unstable'
3225
#[rustc_deprecated(since = "1.0.0", reason = "deprecated")]
3326
#[unstable(feature = "test", issue = "32374", reason = "unstable")]
3427
pub struct U;

0 commit comments

Comments
 (0)