Skip to content

Commit 04de151

Browse files
committed
Struct
1 parent 0a1507d commit 04de151

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
280280
generics: generics.clean(cx),
281281
variants_stripped: false,
282282
})),
283+
ItemKind::Struct(ref variant_data, ref generics) => NotInlined(StructItem(Struct {
284+
struct_type: doctree::struct_type_from_def(&variant_data),
285+
generics: generics.clean(cx),
286+
fields: variant_data.fields().clean(cx),
287+
fields_stripped: false,
288+
})),
283289
ItemKind::Union(ref variant_data, ref generics) => NotInlined(UnionItem(Union {
284290
struct_type: doctree::struct_type_from_def(&variant_data),
285291
generics: generics.clean(cx),
@@ -1896,22 +1902,6 @@ impl Clean<Visibility> for ty::Visibility {
18961902
}
18971903
}
18981904

1899-
impl Clean<Item> for doctree::Struct<'_> {
1900-
fn clean(&self, cx: &DocContext<'_>) -> Item {
1901-
Item::from_hir_id_and_parts(
1902-
self.id,
1903-
Some(self.name),
1904-
StructItem(Struct {
1905-
struct_type: self.struct_type,
1906-
generics: self.generics.clean(cx),
1907-
fields: self.fields.clean(cx),
1908-
fields_stripped: false,
1909-
}),
1910-
cx,
1911-
)
1912-
}
1913-
}
1914-
19151905
impl Clean<VariantStruct> for rustc_hir::VariantData<'_> {
19161906
fn clean(&self, cx: &DocContext<'_>) -> VariantStruct {
19171907
VariantStruct {

src/librustdoc/doctree.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ crate enum StructType {
1818
Unit,
1919
}
2020

21-
crate struct Struct<'hir> {
22-
crate id: hir::HirId,
23-
crate struct_type: StructType,
24-
crate name: Symbol,
25-
crate generics: &'hir hir::Generics<'hir>,
26-
crate fields: &'hir [hir::StructField<'hir>],
27-
}
28-
2921
#[derive(Debug)]
3022
crate struct Static<'hir> {
3123
crate type_: &'hir hir::Ty<'hir>,

0 commit comments

Comments
 (0)