1
Fork 0

Handle correctly stripped enum variant fields

This commit is contained in:
Guillaume Gomez 2022-08-15 14:41:06 +02:00
parent 6ce76091c7
commit c4a5ac2a77

View file

@ -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(),
),