Include type in non-exhaustive message. Include new css in dark theme.
This commit is contained in:
parent
a074bd7334
commit
039709d34f
2 changed files with 6 additions and 4 deletions
|
@ -2265,21 +2265,22 @@ fn document_stability(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item)
|
||||||
|
|
||||||
fn document_non_exhaustive(w: &mut fmt::Formatter, item: &clean::Item) -> fmt::Result {
|
fn document_non_exhaustive(w: &mut fmt::Formatter, item: &clean::Item) -> fmt::Result {
|
||||||
if item.non_exhaustive {
|
if item.non_exhaustive {
|
||||||
|
let name = item.type_();
|
||||||
write!(w, r##"
|
write!(w, r##"
|
||||||
<div class='non-exhaustive'>
|
<div class='non-exhaustive'>
|
||||||
<div class='stab non-exhaustive'>
|
<div class='stab non-exhaustive'>
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
<span class=microscope>🔬</span>
|
<span class=microscope>🔬</span>
|
||||||
This type is marked as non exhaustive.
|
This {} is marked as non exhaustive.
|
||||||
</summary>
|
</summary>
|
||||||
<p>
|
<p>
|
||||||
This type will require a wildcard arm in any match statements or constructors.
|
This {} will require a wildcard arm in any match statements or constructors.
|
||||||
</p>
|
</p>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
"##)?;
|
"##, name, name)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -188,6 +188,7 @@ a.test-arrow {
|
||||||
border-color: #008dfd;
|
border-color: #008dfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.stab.non-exhaustive { background: #2a2a2a; border-color: #707070; }
|
||||||
.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #404040; }
|
.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #404040; }
|
||||||
.stab.deprecated { background: #F3DFFF; border-color: #7F0087; color: #404040; }
|
.stab.deprecated { background: #F3DFFF; border-color: #7F0087; color: #404040; }
|
||||||
.stab.portability { background: #C4ECFF; border-color: #7BA5DB; color: #404040; }
|
.stab.portability { background: #C4ECFF; border-color: #7BA5DB; color: #404040; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue