Fix rustdoc
This commit is contained in:
parent
2a1ea44bdc
commit
c3151c65c6
@ -2416,6 +2416,14 @@ impl Clean<Type> for hir::Ty {
|
||||
Array(box ty.clean(cx), length)
|
||||
},
|
||||
TyKind::Tup(ref tys) => Tuple(tys.clean(cx)),
|
||||
TyKind::Def(item_id, _) => {
|
||||
let item = cx.tcx.hir.expect_item(item_id.id);
|
||||
if let hir::ItemKind::Existential(ref ty) = item.node {
|
||||
ImplTrait(ty.bounds.clean(cx))
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
TyKind::Path(hir::QPath::Resolved(None, ref path)) => {
|
||||
if let Some(new_ty) = cx.ty_substs.borrow().get(&path.def).cloned() {
|
||||
return new_ty;
|
||||
@ -2425,14 +2433,6 @@ impl Clean<Type> for hir::Ty {
|
||||
if let Some(bounds) = cx.impl_trait_bounds.borrow_mut().remove(&did) {
|
||||
return ImplTrait(bounds);
|
||||
}
|
||||
} else if let Def::Existential(did) = path.def {
|
||||
// This block is for returned impl trait only.
|
||||
if let Some(node_id) = cx.tcx.hir.as_local_node_id(did) {
|
||||
let item = cx.tcx.hir.expect_item(node_id);
|
||||
if let hir::ItemKind::Existential(ref ty) = item.node {
|
||||
return ImplTrait(ty.bounds.clean(cx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut alias = None;
|
||||
|
Loading…
x
Reference in New Issue
Block a user