From a085e3bd456c2f8082aad0ce020a57e99fb77eb7 Mon Sep 17 00:00:00 2001 From: mitaa Date: Fri, 12 Feb 2016 09:34:00 +0100 Subject: [PATCH] Fix inherent-associated-const search result links Normal constants have their own page while associated constants are embedded within their parent-items page. --- src/librustdoc/clean/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 5e8b1194da0..12349e63457 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1281,10 +1281,8 @@ impl Clean for hir::ImplItem { fn clean(&self, cx: &DocContext) -> Item { let inner = match self.node { hir::ImplItemKind::Const(ref ty, ref expr) => { - ConstantItem(Constant{ - type_: ty.clean(cx), - expr: expr.span.to_src(cx), - }) + AssociatedConstItem(ty.clean(cx), + Some(expr.span.to_src(cx))) } hir::ImplItemKind::Method(ref sig, _) => { MethodItem(sig.clean(cx))