Skip to content

Commit c3151c6

Browse files
committed
Fix rustdoc
1 parent 2a1ea44 commit c3151c6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,6 +2416,14 @@ impl Clean<Type> for hir::Ty {
24162416
Array(box ty.clean(cx), length)
24172417
},
24182418
TyKind::Tup(ref tys) => Tuple(tys.clean(cx)),
2419+
TyKind::Def(item_id, _) => {
2420+
let item = cx.tcx.hir.expect_item(item_id.id);
2421+
if let hir::ItemKind::Existential(ref ty) = item.node {
2422+
ImplTrait(ty.bounds.clean(cx))
2423+
} else {
2424+
unreachable!()
2425+
}
2426+
}
24192427
TyKind::Path(hir::QPath::Resolved(None, ref path)) => {
24202428
if let Some(new_ty) = cx.ty_substs.borrow().get(&path.def).cloned() {
24212429
return new_ty;
@@ -2425,14 +2433,6 @@ impl Clean<Type> for hir::Ty {
24252433
if let Some(bounds) = cx.impl_trait_bounds.borrow_mut().remove(&did) {
24262434
return ImplTrait(bounds);
24272435
}
2428-
} else if let Def::Existential(did) = path.def {
2429-
// This block is for returned impl trait only.
2430-
if let Some(node_id) = cx.tcx.hir.as_local_node_id(did) {
2431-
let item = cx.tcx.hir.expect_item(node_id);
2432-
if let hir::ItemKind::Existential(ref ty) = item.node {
2433-
return ImplTrait(ty.bounds.clean(cx));
2434-
}
2435-
}
24362436
}
24372437

24382438
let mut alias = None;

0 commit comments

Comments
 (0)