Skip to content

Commit

Permalink
Rollup merge of #106356 - aDotInTheVoid:del-ctor-kind, r=jyn514
Browse files Browse the repository at this point in the history
clean: Remove `ctor_kind` from `VariantStruct`.

It's always `None`.

r? `@ghost`
  • Loading branch information
matthiaskrgr authored Jan 3, 2023
2 parents 6e94012 + f1f99c6 commit a0458d4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}),
};
Expand All @@ -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(..) => {
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
}

Expand Down
11 changes: 1 addition & 10 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
Expand Down

0 comments on commit a0458d4

Please sign in to comment.