mirror of https://github.com/rust-lang/rust.git
rustdoc: tweak `some variants omitted`
Don't display `// some variants omitted` if enum is marked `#[non_exhaustive]`
This commit is contained in:
parent
0c61c7a978
commit
e0ec9c0b9c
|
@ -1234,7 +1234,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
|
|||
w.write_str(",\n");
|
||||
}
|
||||
|
||||
if variants_stripped {
|
||||
if variants_stripped && !it.is_non_exhaustive() {
|
||||
w.write_str(" // some variants omitted\n");
|
||||
}
|
||||
if toggle {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
// @has issue_108925/enum.MyThing.html
|
||||
// @has - '//code' 'Shown'
|
||||
// @!has - '//code' 'NotShown'
|
||||
// @!has - '//code' '// some variants omitted'
|
||||
#[non_exhaustive]
|
||||
pub enum MyThing {
|
||||
Shown,
|
||||
#[doc(hidden)]
|
||||
NotShown,
|
||||
}
|
||||
|
Loading…
Reference in New Issue