Rollup merge of #106356 - aDotInTheVoid:del-ctor-kind, r=jyn514

clean: Remove `ctor_kind` from `VariantStruct`.

It's always `None`.

r? `@ghost`
This commit is contained in:
Matthias Krüger 2023-01-03 17:12:11 +01:00 committed by GitHub
commit a0458d41ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 13 deletions

View File

@ -1960,7 +1960,6 @@ pub(crate) fn clean_variant_def<'tcx>(variant: &ty::VariantDef, cx: &mut DocCont
variant.fields.iter().map(|field| clean_middle_field(field, cx)).collect(),
),
None => VariantKind::Struct(VariantStruct {
ctor_kind: None,
fields: variant.fields.iter().map(|field| clean_middle_field(field, cx)).collect(),
}),
};
@ -1985,7 +1984,6 @@ fn clean_variant_data<'tcx>(
let kind = match variant {
hir::VariantData::Struct(..) => VariantKind::Struct(VariantStruct {
ctor_kind: None,
fields: variant.fields().iter().map(|x| clean_field(x, cx)).collect(),
}),
hir::VariantData::Tuple(..) => {

View File

@ -2111,7 +2111,6 @@ impl Union {
/// only as a variant in an enum.
#[derive(Clone, Debug)]
pub(crate) struct VariantStruct {
pub(crate) ctor_kind: Option<CtorKind>,
pub(crate) fields: Vec<Item>,
}

View File

@ -1229,16 +1229,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
w.write_str(")");
}
clean::VariantKind::Struct(ref s) => {
render_struct(
w,
v,
None,
s.ctor_kind,
&s.fields,
" ",
false,
cx,
);
render_struct(w, v, None, None, &s.fields, " ", false, cx);
}
},
_ => unreachable!(),