Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/librustdoc/json/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,12 +662,10 @@ impl FromWithTcx<clean::Variant> for Variant {
Tuple(fields) => Variant::Tuple(
fields
.into_iter()
.map(|f| {
if let clean::StructFieldItem(ty) = *f.kind {
ty.into_tcx(tcx)
} else {
unreachable!()
}
.filter_map(|f| match *f.kind {
clean::StructFieldItem(ty) => Some(ty.into_tcx(tcx)),
clean::StrippedItem(_) => None,
_ => unreachable!(),
})
.collect(),
),
Expand Down
13 changes: 13 additions & 0 deletions src/test/rustdoc-json/enum_variant_hidden.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Regression test for <https://github.com/rust-lang/rust/issues/100529>.

#![no_core]
#![feature(no_core)]

// @has enum_variant_hidden.json "$.index[*][?(@.name=='ParseError')]"
// @has - "$.index[*][?(@.name=='UnexpectedEndTag')]"
// @is - "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant_kind" '"tuple"'
// @is - "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant_inner" []

pub enum ParseError {
UnexpectedEndTag(#[doc(hidden)] u32),
}