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 + } } }