about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustdoc/json/conversions.rs10
-rw-r--r--src/test/rustdoc-json/enum_variant_hidden.rs13
2 files changed, 17 insertions, 6 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs
index 5f3793ead42..1fedb0144d1 100644
--- a/src/librustdoc/json/conversions.rs
+++ b/src/librustdoc/json/conversions.rs
@@ -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(),
             ),
diff --git a/src/test/rustdoc-json/enum_variant_hidden.rs b/src/test/rustdoc-json/enum_variant_hidden.rs
new file mode 100644
index 00000000000..96c96a975d3
--- /dev/null
+++ b/src/test/rustdoc-json/enum_variant_hidden.rs
@@ -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),
+}