Skip to content

Commit c4a5ac2

Browse files
Handle correctly stripped enum variant fields
1 parent 6ce7609 commit c4a5ac2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/librustdoc/json/conversions.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -662,12 +662,10 @@ impl FromWithTcx<clean::Variant> for Variant {
662662
Tuple(fields) => Variant::Tuple(
663663
fields
664664
.into_iter()
665-
.map(|f| {
666-
if let clean::StructFieldItem(ty) = *f.kind {
667-
ty.into_tcx(tcx)
668-
} else {
669-
unreachable!()
670-
}
665+
.filter_map(|f| match *f.kind {
666+
clean::StructFieldItem(ty) => Some(ty.into_tcx(tcx)),
667+
clean::StrippedItem(_) => None,
668+
_ => unreachable!(),
671669
})
672670
.collect(),
673671
),

0 commit comments

Comments
 (0)