Skip to content

Commit 039709d

Browse files
committed
Include type in non-exhaustive message. Include new css in dark theme.
1 parent a074bd7 commit 039709d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/librustdoc/html/render.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -2265,21 +2265,22 @@ fn document_stability(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item)
22652265

22662266
fn document_non_exhaustive(w: &mut fmt::Formatter, item: &clean::Item) -> fmt::Result {
22672267
if item.non_exhaustive {
2268+
let name = item.type_();
22682269
write!(w, r##"
22692270
<div class='non-exhaustive'>
22702271
<div class='stab non-exhaustive'>
22712272
<details>
22722273
<summary>
22732274
<span class=microscope>🔬</span>
2274-
This type is marked as non exhaustive.
2275+
This {} is marked as non exhaustive.
22752276
</summary>
22762277
<p>
2277-
This type will require a wildcard arm in any match statements or constructors.
2278+
This {} will require a wildcard arm in any match statements or constructors.
22782279
</p>
22792280
</details>
22802281
</div>
22812282
</div>
2282-
"##)?;
2283+
"##, name, name)?;
22832284
}
22842285

22852286
Ok(())

src/librustdoc/html/static/themes/dark.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ a.test-arrow {
188188
border-color: #008dfd;
189189
}
190190

191+
.stab.non-exhaustive { background: #2a2a2a; border-color: #707070; }
191192
.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #404040; }
192193
.stab.deprecated { background: #F3DFFF; border-color: #7F0087; color: #404040; }
193194
.stab.portability { background: #C4ECFF; border-color: #7BA5DB; color: #404040; }
@@ -406,4 +407,4 @@ kbd {
406407
}
407408
.search-results td span.grey {
408409
color: #ccc;
409-
}
410+
}

0 commit comments

Comments
 (0)