Skip to content

Commit

Permalink
Fix rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Oct 2, 2018
1 parent 2a1ea44 commit c3151c6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit c3151c6

Please sign in to comment.