mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rustdoc support
This commit is contained in:
parent
4265ef8cb2
commit
a4d1807d6d
@ -1500,6 +1500,16 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
TyKind::ImplTraitInTrait(item_id) => {
|
||||
let item = cx.tcx.hir().item(item_id);
|
||||
if let hir::ItemKind::ImplTraitPlaceholder(hir::ImplTraitPlaceholder { bounds }) =
|
||||
item.kind
|
||||
{
|
||||
ImplTrait(bounds.iter().filter_map(|x| clean_generic_bound(x, cx)).collect())
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
TyKind::Path(_) => clean_qpath(ty, cx),
|
||||
TyKind::TraitObject(bounds, ref lifetime, _) => {
|
||||
let bounds = bounds.iter().map(|bound| clean_poly_trait_ref(bound, cx)).collect();
|
||||
|
@ -135,6 +135,7 @@ impl From<DefKind> for ItemType {
|
||||
| DefKind::AnonConst
|
||||
| DefKind::InlineConst
|
||||
| DefKind::OpaqueTy
|
||||
| DefKind::ImplTraitPlaceholder
|
||||
| DefKind::Field
|
||||
| DefKind::LifetimeParam
|
||||
| DefKind::GlobalAsm
|
||||
|
@ -1805,8 +1805,8 @@ fn resolution_failure(
|
||||
}
|
||||
return;
|
||||
}
|
||||
Trait | TyAlias | ForeignTy | OpaqueTy | TraitAlias | TyParam
|
||||
| Static(_) => "associated item",
|
||||
Trait | TyAlias | ForeignTy | OpaqueTy | ImplTraitPlaceholder
|
||||
| TraitAlias | TyParam | Static(_) => "associated item",
|
||||
Impl | GlobalAsm => unreachable!("not a path"),
|
||||
}
|
||||
} else {
|
||||
|
@ -362,6 +362,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
||||
| hir::ItemKind::Union(..)
|
||||
| hir::ItemKind::TyAlias(..)
|
||||
| hir::ItemKind::OpaqueTy(..)
|
||||
| hir::ItemKind::ImplTraitPlaceholder(..)
|
||||
| hir::ItemKind::Static(..)
|
||||
| hir::ItemKind::Trait(..)
|
||||
| hir::ItemKind::TraitAlias(..) => om.items.push((item, renamed)),
|
||||
|
Loading…
Reference in New Issue
Block a user