From 20f759fdcebca91d4a425996894a2818d9452925 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Fri, 8 Jun 2018 11:09:05 +0200 Subject: [PATCH] Fix rustdoc --- src/librustdoc/clean/mod.rs | 9 ++++++++- src/librustdoc/visit_ast.rs | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 751a414e3c7c..4f36eee91013 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2897,7 +2897,14 @@ impl Clean for hir::Ty { } } TyBareFn(ref barefn) => BareFunction(box barefn.clean(cx)), - TyImplTraitExistential(ref exist_ty, _, _) => ImplTrait(exist_ty.bounds.clean(cx)), + TyImplTraitExistential(hir_id, _, _) => { + match cx.tcx.hir.expect_item(hir_id.id).node { + hir::ItemExistential(ref exist_ty) => { + ImplTrait(exist_ty.bounds.clean(cx)) + }, + ref other => panic!("impl Trait pointed to {:#?}", other), + } + }, TyInfer | TyErr => Infer, TyTypeof(..) => panic!("Unimplemented type {:?}", self.node), } diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 8c2555c4b3de..f0b687b9554a 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -559,6 +559,9 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> { om.impls.push(i); } }, + hir::ItemExistential(_) => { + // FIXME(oli-obk): actually generate docs for real existential items + } } }