Skip to content

Commit 1589dda

Browse files
committed
GlobalAsm and TypedefItem
1 parent a781126 commit 1589dda

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
262262
// TODO: this should also take the span into account (inner or outer)
263263
ItemKind::Mod(ref mod_) => NotInlined(mod_.clean(cx)),
264264
ItemKind::ForeignMod(ref mod_) => NotInlined(mod_.clean(cx)),
265+
ItemKind::GlobalAsm(..) => MaybeInlined::InlinedWithoutOriginal(vec![]), // not handled
266+
ItemKind::TyAlias(ty, ref generics) => {
267+
let rustdoc_ty = ty.clean(cx);
268+
let item_type = rustdoc_ty.def_id().and_then(|did| inline::build_ty(cx, did));
269+
NotInlined(TypedefItem(
270+
Typedef { type_: rustdoc_ty, generics: generics.clean(cx), item_type },
271+
false,
272+
))
273+
}
265274
ItemKind::Union(ref variant_data, ref generics) => NotInlined(UnionItem(Union {
266275
struct_type: doctree::struct_type_from_def(&variant_data),
267276
generics: generics.clean(cx),
@@ -2066,19 +2075,6 @@ impl Clean<String> for Symbol {
20662075
}
20672076
}
20682077

2069-
impl Clean<Item> for doctree::Typedef<'_> {
2070-
fn clean(&self, cx: &DocContext<'_>) -> Item {
2071-
let type_ = self.ty.clean(cx);
2072-
let item_type = type_.def_id().and_then(|did| inline::build_ty(cx, did));
2073-
Item::from_hir_id_and_parts(
2074-
self.id,
2075-
Some(self.name),
2076-
TypedefItem(Typedef { type_, generics: self.gen.clean(cx), item_type }, false),
2077-
cx,
2078-
)
2079-
}
2080-
}
2081-
20822078
impl Clean<Item> for doctree::OpaqueTy<'_> {
20832079
fn clean(&self, cx: &DocContext<'_>) -> Item {
20842080
Item::from_hir_id_and_parts(

src/librustdoc/doctree.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ crate struct Variant<'hir> {
3939
crate def: &'hir hir::VariantData<'hir>,
4040
}
4141

42-
crate struct Typedef<'hir> {
43-
crate ty: &'hir hir::Ty<'hir>,
44-
crate gen: &'hir hir::Generics<'hir>,
45-
crate name: Symbol,
46-
crate id: hir::HirId,
47-
}
48-
4942
crate struct OpaqueTy<'hir> {
5043
crate opaque_ty: &'hir hir::OpaqueTy<'hir>,
5144
crate name: Symbol,

0 commit comments

Comments
 (0)